270 likes | 399 Views
CS 23022 Discrete Mathematical Structures. Mehdi Ghayoumi MSB rm 132 mghayoum@kent.edu Ofc hr : Thur , 9:30-11:30a. Announcements. Homework 3 available. Due 06/19, 8a . Solutions are Available at 8.01 a Midterm 1: Monday,June-30, location 121 rm. Functions. Functions.
E N D
CS 23022Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 mghayoum@kent.edu Ofchr: Thur, 9:30-11:30a
Announcements Homework 3 available. Due 06/19, 8a. Solutions are Available at 8.01 a Midterm 1: Monday,June-30, location 121 rm.
Functions Suppose we have: And I ask you to describe the yellow function. What’s a function? f(x) = x Notation: f: RR, f(x) = x co-domain domain
Functions Suppose we have: And I ask you to describe the yellow function. What’s a function? f(x) = x +20
Functions Suppose we have: And I ask you to describe the yellow function. What’s a function? f(x) = x -20
Functions Suppose we have: And I ask you to describe the yellow function. What’s a function? f(x) = -x Notation: f: RR, f(x) = -x co-domain domain
Functions Suppose we have: And I ask you to describe the yellow function. What’s a function? f(x) = -x+20
Functions Suppose we have: And I ask you to describe the yellow function. What’s a function? f(x) = -x-20
Michael Tito Janet Cindy Bobby Katherine Carol Brady Mother Teresa Functions A = {Michael, Tito, Janet, Cindy, Bobby} B = {Katherine, Carol Brady, Mother Teresa} Let f: A B be defined as f(a) = mother(a).
Michael Tito Janet Cindy Bobby Katherine Carol Brady Mother Teresa Some say it means codomain, others say, image. Functions - image & preimage For any set S A, image(S) = {b : a S, f(a) = b} So, image({Michael, Tito}) = {Katherine } image(A) = B - {Mother Teresa} image(S) = f(S)
Michael Tito Janet Cindy Bobby Katherine Carol Brady Mother Teresa Functions - image & pre image For any S B, preimage(S) = {a: b S, f(a) = b} So, preimage({Carol Brady}) = {Cindy, Bobby} preimage(B) = A preimage(S) = f-1(S)
Michael Tito Janet Cindy Bobby Katherine Carol Brady Mother Teresa Suppose S is {Janet, Cindy} preimage(image(S)) = A Functions - image & pre image What is preimage(image(S))?
Functions - injection A function f: A B is one-to-one (injective, an injection) if a,b,c, (f(a) = b f(c) = b) a = c one-to-one Every b B has at most 1 preimage.
Functions - injection A function f: A B is one-to-one (injective, an injection) if a,b,c, (f(a) = b f(c) = b) a = c one-to-one Every b B has at most 1 preimage.
Functions – Not-injection Not one-to-one
. Functions - surjective • A function f : A → B is said to surjective or onto if the range of f is equal to B(co-domain), i.e. every element of B has its pre-image in A under the given function f. • So ∀ b ∈ B ∃ a ∈ A, such that f(a) =b onto
Functions - injection not onto
Functions - bijection A function f: A B is bijective if it is one-to-one and onto. Every b B has exactly 1 preimage.
yes yes yes Functions - examples Suppose f: R+ R+, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective?
no yes no Functions - examples Suppose f: R R+, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective?
no no no Functions - examples Suppose f: R R, f(x) = x2. Is f one-to-one? Is f onto? Is f bijective?
Functions - composition Let f:AB, and g:BC be functions. Then the composition of f and g is: (g o f)(x) = g(f(x))
Functions - composition Let f = {(1,3), (2,1), (3,4), (4,6)} and let g = {(1,5), (2,3), (3,4), (4,1), (5,3), (6,2)}. Then g o f = {(1,4), (2,5), (3,1), (4,2)}. Given f(x) = 2x + 3 and g(x) = –x2 + 5…. find ( f o g)(x). (f o g)(x) = f (g(x)) = f (–x2 + 5) = 2( ) + 3 ... setting up to insert the input formula = 2(–x2 + 5) + 3 = –2x2 + 10 + 3 = –2x2 + 13