CSE 1400 Applied Discrete Mathematics Functions Department of Computer Sciences College of Engineering Florida Tech Fall 2011

CSE 1400 Applied Discrete Mathematics Functions Department of Computer Sciences College of Engineering Florida Tech Fall 2011

CSE 1400 Applied Discrete Mathematics Functions Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Functions 1 Counting Functions 2 Onto Functions 3 One-to-One Functions 3 Cardinality Defined 4 Inverse Function 4 Function Composition 4 Problems on Functions 5 Abstract A function is a deterministic relation. Functions In college algebra and pre-calculus, you In college algebra, the function concept is often explained by the have studied functions such as vertical line test: “If every vertical line crosses a graph at most once, = the graph represents a function.” A given value x in the domain y x log x cos x y = x2 y = ex = of a function maps to one and only one value y in the range of the y y = y = sin x function. Functions are denoted by writing f : X ! Y where X is the domain and Y is the co-domain of function f . The range G of f is the subset of Y for which there is an x 2 X such that y = f (x). The range of f also called the image of X and written G = f (X) ⊆ Y To write f is a function from X to Y in predicate logic requires the conjunction of two propositions. (8x 2 X)(9y 2 Y)( f (x) = y) cse 1400 applied discrete mathematics functions 2 y Figure 1: The vertical line x = 0.5 crossesp the circle twice. The relation p y = ± 1 − x2 between x and y is not a 1 x = 1/2, y = 3/2 function. 1 2 x −1 1 1 − 2 1 − 2 p x = 1/2, y = − 3/2 −1 x2 + y2 = 1 is relation, but not a function. and (8x 2 X)(8y, z 2 Y)(( f (x) = y ^ f (x) = z) =) y = z) The first proposition states that every element x in the domain maps to some element y in the range: The function is total. The second predicate states that if x maps to two different names y and z, their values are, in fact, equal. There are several things worth knowing about functions. For instance, it is useful to know The number of different functions from X to Y that can be de- fined. Basic properties such as onto and one-to-one. When a function can be inverted. How functions can be composed using the output of one function as the input to another. And, it is useful to have a collection of functions that occur fre- quently in computing applications. Counting Functions It is easy to construct a function. For every x in the domain, choose a single y in the co-domain and include the pair (x, y) in cse 1400 applied discrete mathematics functions 3 function. For instance, you can construct 32 functions from fa, bg to set f0, 1, 2g: For x = a choose y = 0, y = 1, or y = 2; For x = b choose y = 0, y = 1, or y = 2. Each of these 9 functions can be represented by one of the 9 sets below. f(a, 0), (b, 0)g f(a, 0), (b, 1)g f(a, 0), (b, 2)g f(a, 1), (b, 0)g f(a, 1), (b, 1)g f(a, 1), (b, 2)g f(a, 2), (b, 0)g f(a, 2), (b, 1)g f(a, 2), (b, 2)g Another example: if jXj = 6 and jYj = 5, then 56 functions from X to Y can be defined. In general, if jXj = n and jYj = m, there are For each of the six x’s choose one of the five y’s to map x to. That’s 5 choices 6 mn = jYjjXj times. functions from X to Y. Onto Functions A function f : X ! Y is onto when itsco -domain Y is its range. In college algebra, the concept of “onto function” is often f : X ! Y is onto when f (X) = Y. explained by the horizontal line test: If every horizontal line crosses Otherwise, f is said to map X into Y. f : X ! Y is onto when the graph of the function y = f (x), then f is onto. Another way to visualize the meaning of onto is to fill or not completely fill the (8y 2 Y)(9x 2 X)( f (x) = y) co-domain in the illustration of a function. 0.5 ) 3 − x )( 2 0 − f f x )( 1 − x −0.5 ( x = 4 X Y X Y x = −1 y 0 0.5 1 1.5 2 2.5 3 x f maps X onto Y f does not map X onto Y The falling power x4 is not onto R. 4 ) 4 It is useful to note that when X has fewer elements than Y it is not − x )( 3 2 − possible to construct onto functions from X to Y. That is, if jXj < x )( 2 − jYj, then x 0 )( 1 − x (8( f X ! Y))( f ) ( : is not onto x −2 = 5 x = y −4 One-to-One Functions 0 1 2 3 4 x The falling power x5 is onto R. Function f is one-to-one when no element y in its range is the image of more than domain element x. In college al- f : X ! Y is one-to-one when gebra, this concept is often explained by another horizontal line test: (8x0, x1 2 X)((x0 6= x1) =) f (x0) 6= f (x1) If every horizontal line crosses the graph of y = f (x) at most once cse 1400 applied discrete mathematics functions 4 then f is one-to-one. If the cardinality of X is greater than that of 4 Y, then no (total) one-to-one function can exist. This is known as the 1 pigeonhole principle. You can’t put 10 pigeons in 9 pigeonholes. + 2 x + 2 x + 3 x 0 = y −2 −1 −0.5 0 0.5 1 x The geometric sum y = x3 + x2 + x + 1 is a one-to-one function. Cardinality Defined The cardinalities of two sets X and Y are equal when there is a one-to-one function f that maps X onto Y. In particular, X has cardinality n when its elements can be put onto a one-to-one correspondence with Zn = f0, 1, . (n − 1)g. Inverse Function A key to cryptology is to find a function f that is easy to compute and all but impossible to invert. The inverse of a relation f(a, b) : a ∼ bg is the set f(b, a) : a ∼ bg. When f is a function from X to Y, that is, when f = f(a, b) 2 X × Y : f (a) = bg simply reversing the order of its pairs will define a relation between Y and X, but the resulting set may not be a function. That is, b may be the image of more that one value a 2 X. Some b 2 Y may not be f −1 = f(b, a) : f (a) = bg the image of any value a 2 X. may not be a function from Y to X. If f is one-to-one, then f −1 is a partial function. If f is one-to-one and onto, then f −1 is a total function. Function Composition Complex functions can be constructed from simple func- tions. The diagram below illustrates composition of functions f : X ! Y g : Y ! Z cse 1400 applied discrete mathematics functions 5 and follows an element x mapped by f to y which g maps to z. y X f Y g Z z x The composition of f : X ! Y and g : Y ! Z is denoted g ◦ f , and (g ◦ f )(x) = g( f (x)) Problems on Functions 1. Let f : X ! Y be a function. Answer the following True or False. Explain your answer. (a) The set X is the range of function f . (b) The set X is the domain of function f . (c) The set Y is the range of function f . (d) The set Y is the domain of function f . 2. Let A = fa, b, cg and B = f0, 1g. Which of the following are functions from A to B. (a) f(a, 0), (b, 1), (c, 0)g (c) f(a, b), (b, a), (a, c)g (b) f(a, 0), (a, 1), (c, 0)g (d) f(a, 1), (b, 1), (c, 1)g 3. Consider this algorithm for constructing a function f from X to Y. For each element x 2 X choose an element y 2 Y and place the ordered pair (x, y) in f . (a) If the cardinality of X is 5, how many times does the algorithm choose an x from X? (b) If the cardinality of Y is 9, how many choice of y are there for each x? (c) True or False: If the jXj = 5 and jYj = 9, then there are 59 functions f from X to Y. Explain your answer. (d) True or False: If the jXj = 5 and jYj = 9 then there are 45 functions f from X to Y. Explain your answer. (e) True or False: If the jXj = 5 and jYj = 9 then there are 95 functions f from X to Y. Explain your answer. (f) If jXj = n and jYj = m how many functions f can be defined from X to Y? 4. Answer the following True or False. Explain your answer. (a) The domain of a function of one Boolean variable is f0, 1g. (b) The domain of a function of two Boolean variables is f(0, 0), (0, 1), (1, 0), (1, 1)g.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us