Presentation is loading. Please wait.

Presentation is loading. Please wait.

Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and.

Similar presentations


Presentation on theme: "Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and."— Presentation transcript:

1 Functions

2 L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and exponentiation Ceiling “  ” and floor “  ”

3 L63 Functions In high-school, functions are often identified with the formulas that define them. EG: f (x ) = x 2 This point of view does not suffice in Discrete Math. In discrete math, functions are not necessarily defined over the real numbers. EG: f (x ) = 1 if x is odd, and 0 if x is even. So in addition to specifying the formula one needs to define the set of elements which are acceptable as inputs, and the set of elements into which the function outputs.

4 L64 Functions. Basic-Terms. DEF: A function f : A  B is given by a domain set A, a codomain set B, and a rule which for every element a of A, specifies a unique element f (a) in B. f (a) is called the image of a, while a is called the pre-image of f (a). The range (or image) of f is defined by f (A) = {f (a) | a  A }.

5 L65 Functions. Basic-Terms. EG: Let f : Z  R be given by f (x ) = x 2 Q1: What are the domain and co-domain? Q2: What’s the image of -3 ? Q3: What are the pre-images of 3, 4? Q4: What is the range f (Z) ?

6 L66 Functions. Basic-Terms. f : Z  R is given by f (x ) = x 2 A1: domain is Z, co-domain is R A2: image of -3 = f (-3) = 9 A3: pre-images of 3: none as  3 isn’t an integer! pre-images of 4: -2 and 2 A4: range is the set of perfect squares f (Z) = {0,1,4,9,16,25,…}

7 L67 Functions. Sub-ranges. The effect of functions on subsets of the domain is often important. DEF: Given a function f : A  B. The pre- image set (or inverse image) of b is defined by f -1 (b) = {a  A | f (a)=b }. Given subsets S  A and T  B, the image set of S is defined by f (S ) = {f(a ) | a  S } and the pre-image set (or inverse image) of T is defined by f -1 (T ) = {a  A | f (a)  T }. NOTE: Even when f is not invertible, the inverse image is defined!

8 L68 Functions. Sub-ranges. EG: f : Z  R with f (x ) = x 2 Q1: Calculate f –1 (3) Q2: Calculate f –1 (4) Q3: Calculate f ( {-9,-5,-3,0,1,2,3,4} ) Q4: Calculate f –1 ({-9,-5,-3,0,0.25,1,2,2.25,3,4})

9 L69 Functions. Sub-ranges. EG: f : Z  R with f (x ) = x 2 A1: f –1 (3) =  A2: f –1 (4) = {-2, 2} A3: f ( {-9,-5,-3,0,1,2,3,4} ) = {81,25,9,0,1,4,16} A4:f –1 ({-9,-5,-3,0,0.25,1,2,2.25,3,4}) = {0,-1,1,-2,2}

10 L610 One-to-One, Onto, Bijection. Intuitively. Represent functions using “node and arrow” notation: One-to-One means that no clashes occur. BAD:a clash occurred, not 1-to-1 GOOD:no clashes, is 1-to-1 Onto means that every possible output is hit BAD: 3 rd output missed, not onto GOOD:everything hit, onto

11 L611 One-to-One, Onto, Bijection. Intuitively. Bijection means that when arrows reversed, a function results. Equivalently, that both one-to-one’ness and onto’ness occur. BAD:not 1-to-1. Reverse over-determined: BAD:not onto. Reverse under-determined: GOOD:Bijection. Reverse is a function:

12 L612 One-to-One, Onto, Bijection. Formal Definition. DEF: A function f : A  B is: one-to-one (or injective) if different elements of A always result in different images in B. onto (or surjective) if every element in B is hit by f. I.e., f (A ) = B. a one-to-one correspondence (or a bijection, or invertible) if f is both one-to-one as well as onto. If f is invertible, its inverse f -1 : B  A is well defined by taking the unique element in the pre- image of b, for each b  B.

13 L613 One-to-One, Onto, Bijection. Examples. Q: Which of the following are 1-to-1, onto, a bijection? If f is invertible, what is its inverse? 1. f : Z  R is given by f (x ) = x 2 2. f : Z  R is given by f (x ) = 2x 3. f : R  R is given by f (x ) = x 3 4. f : Z  N is given by f (x ) = |x |

14 L614 One-to-One, Onto, Bijection. Examples. 1. f : Z  R, f (x ) = x 2 : none 1. not 1-1 clashes for -1,1 in Z 2. not onto -1,-2 missed from R 2. f : Z  R, f (x ) = 2x : 1-1 3. f : R  R, f (x ) = x 3 : 1-1, onto, bijection, inverse is f (x ) = x (1/3) 4. f : Z  N, f (x ) = |x |: onto

15 L615 Composition When a function f spits out elements of the same kind that another function g eats, f and g may be composed by letting g immediately eat each output of f. DEF: Suppose that g : A  B and f : B  C are functions. Then the composite f  g : A  C is defined by setting f  g (a) = f ( g (a) )

16 L616 Composition. Examples. Q: Compute g  f where 1.f : Z  R, f (x ) = x 2 and g : R  R, g (x ) = x 3 2. f : Z  Z, f (x ) = x + 1 and g = f -1 so g (x ) = x – 1 3. f : {people}  {people}, f (x ) = the father of x, and g = f

17 L617 Composition. Examples. 1.f : Z  R, f (x ) = x 2 and g : R  R, g (x ) = x 3 f  g : Z  R, f  g (x ) = x 6 2. f : Z  Z, f (x ) = x + 1 and g = f -1 f  g (x ) = x (true for any function composed with its inverse) 3. f : {people}  {people}, f (x ) = g(x ) = the father of x f  g (x ) = grandfather of x from father’s side

18 L618 Repeated Composition When the domain and codomain are equal, a function may be self composed. The composition may be repeated as much as desired resulting in functional exponentiation. The whole process is denoted by f n (x ) = f  f  f  f  …  f (x ) where f appears n –times on the right side. Q1: Given f : Z  Z, f (x ) = x 2 find f 4 Q2: Given g : Z  Z, g (x ) = x + 1 find g n Q3: Given h(x ) = the father of x, find h n

19 L619 Repeated Composition A1: f : Z  Z, f (x ) = x 2. f 4 (x ) = x (2*2*2*2) = x 16 A2: g : Z  Z, g (x ) = x + 1 g n (x ) = x + n A3: h (x ) = the father of x, h n (x ) = x ’s n’th patrilineal ancestor

20 L620 Ceiling and Floor This being a course on discrete math, it is often useful to discretize numbers, sets and functions. For this purpose the ceiling and floor functions come in handy. DEF: Given a real number x : The floor of x is the biggest integer which is smaller or equal to x The ceiling of x is the smallest integer greater or equal to x. NOTATION: floor(x) =  x , ceiling(x) =  x  Q: Compute  1.7 ,  -1.7 ,  1.7 ,  -1.7 .

21 L621 Ceiling and Floor A:  1.7  = 1,  -1.7  = -2,  1.7  = 2,  -1.7  = -1 Prove : show that for all positive real numbers x, y:  x.y  <=  x .  y 


Download ppt "Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and."

Similar presentations


Ads by Google