Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,

Similar presentations


Presentation on theme: "1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,"— Presentation transcript:

1 1 Section 1.8 Functions

2 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something, but that something need not be unique; 2 or more elements of 1st set can map to single element in 2nd set –however, no element of 1st set can map to more than one element of 2nd set

3 3 Examples Let A = {x, y, z} and B = {1, 2, 3}

4 4 Formal Definition Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A In more algebraic terms: f(a) = b if b  B and is the unique element assigned to a  A If f is a function from A to B we write f: A  B

5 5 Specifying Functions Can explicitly state assignments, e.g. f(x)=2, f(y)=1, f(z)=3 Can write as formula, e.g. f(x)=x+1

6 6 Some Terminology Given f:A  B –A is the domain of f –B is the co-domain of f Given f(a)=b –b is the image of a –a is the pre-image of b The range of f is the set of all images of elements of A

7 7 Examples f(x)=2, f(y)=1, f(z)=3 domain is {x,y,z} co-domain is {1,2,3} range is {1,2,3} f(x)=2, f(y)=2, f(z)=2 domain is {x,y,z} co-domain is {1,2,3} range is {2} Suppose A=N and B=N and f:A  B = f(x) = x*2 Then the domain and co-domain are N; the range is the positive even integers

8 8 Addition & Multiplication of Functions Two real-valued functions with the same domain can be added and multiplied Where f 1 : A  R and f 2 : A  R, (f 1 + f 2 )(x) = f 1 (x) + f 2 (x) and (f 1 f 2 )(x) = f 1 (x) * f 2 (x) For example, let f 1 : R  R = f 1 (x) = x + 2 and f 2 : R  R = f 2 (x) = x 2 + 3 (f 1 + f 2 )(x) = f 1 (x) + f 2 (x) = (x + 2) + (x 2 + 3) = x 2 + x + 5 (f 1 f 2 )(x) = f 1 (x) * f 2 (x) = (x + 2)(x 2 + 3) = x 3 + 2x 2 + 3x + 6

9 9 Image of a Subset Given f:A  B and S  A The image of S is the subset of B that consists of the images of the elements of S: f(S) = {f(s) | s  S} For example: Suppose S = {x,y} Then the image of S is the set f(S) = {3,1}

10 10 One-to-one, or Injective Functions If each member of set A has a unique image in function f, then the domain of f:A  B is said to be a one-to-one function A one-to-one function is also called an injection A function is injective if and only if f(x) = f(y) implies that x=y in the domain of f

11 11 Examples Let A = Z and B = Z and f:A  B = f(n) = n - 1 Suppose n = x = y If x = y then x-1 = y - 1 So f is one-to-one Let A = Z and B = Z and f:A  B = f(n) = n 2 + 1 Suppose n = x = y If x = y then x 2 + 1 = y 2 + 1, and x 2 = y 2 But, for example, -2 2 = 2 2 So f is not one-to-one

12 12 Strictly Increasing/Decreasing Functions If A  R and B  R and f:A  B and x & y are in the domain of f, If f(x) < f(y) whenever x<y, then f is said to be strictly increasing If f(x) > f(y) whenever x<y, then f is said to be strictly decreasing All such functions are one-to-one

13 13 Surjective (Onto) Functions A function f:A  B is surjective if and only if for every element b  B, there is an element a  A with f(a) = b In other words, if all elements in B have an A element or elements mapped to them, it’s a surjective function Or, all elements in co-domain are images of elements in domain; range = co-domain

14 14 Bijection: One-to-one Correspondence If a function is BOTH injective and surjective (one-to-one and onto), it is bijective If A is a finite set, and f is a function from A to itself (f:A  A), then f is injective ONLY if it is surjective

15 15 Identity function on a set The identity function assigns each element of a set to itself i A : A  A where i A (x) = x where x  A

16 16 Inverse Function Given f:A  B, and f is a bijection The inverse function of f, denoted f -1, assigns to an element b  B the unique element a  A such that f(a)=b In other words, when f(a)=b, f -1 (b)=a A bijection is invertible because its inverse can be defined; a function that is not a bijection is not invertible

17 17 Composition of 2 functions Given two functions, f and g such that g:A  B and f:B  C, The composition of f and g, denoted (f o g)(a), is f(g(a)) Take the result of g(a) and plug it into f to get (f o g)(a) f o g can only be defined if the range of g is a subset of the range of f

18 18 Example Find f o g and g o f where f:R  R = f(x) = x 2 + 1 and g:R  R = g(x) = x + 2 f o g = f(g(x)) = f(x+2) = (x+2) 2 + 1 = x 2 + 4x + 5 g o f = g(f(x)) = g(x 2 + 1) = (x 2 + 1) + 2 = x 2 + 3

19 19 Notes on Composition As is evident from the previous example, the commutative law does not apply to composition; in other words, f o g  g o f When the composition of a function and its inverse is found, an identity function is obtained: (f -1 ) -1 = f

20 20 Graphs of Functions The graph of a function is a set of ordered pairs For f:A  B, the graph of f is the set defined as: { a,b | a  A and b  B }

21 21 Floor & Ceiling Functions Floor function: assigns to real number x the largest whole number that is less than or equal to x - denoted  x  or [x] Ceiling function: assigns to real number x the smallest whole number that is greater than or equal to x - denoted  x  These functions have useful applications involving the storage & transmission of data

22 22 Example How many bytes are required to encode 11,325 bits of data for transmission (as strings of 8-bit bytes)? Dividing 11,325 bits by 8 bits per byte produces the result 1415.625 Since we can’t transmit anything smaller than a byte, we use the ceiling function to find the closest usable whole number:  1415.625  = 1416

23 23 Section 1.6 Functions -ends-


Download ppt "1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,"

Similar presentations


Ads by Google