Functions1 Elementary Discrete Mathematics Jim Skon.

Slides:



Advertisements
Similar presentations
1.6 Functions. Chapter 1, section 6 Functions notation: f: A B x in A, y in B, f(x) = y. concepts: –domain of f, –codomain of f, –range of f, –f maps.
Advertisements

Functions Section 2.3 of Rosen Fall 2008
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
CSE115/ENGR160 Discrete Mathematics 02/16/12 Ming-Hsuan Yang UC Merced 1.
Functions Goals Introduce the concept of function Introduce injective, surjective, & bijective functions.
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,
Functions.
Functions. Let A and B be sets A function is a mapping from elements of A to elements of B and is a subset of AxB i.e. can be defined by a set of tuples!
1 CMSC 250 Chapter 7, Functions. 2 CMSC 250 Function terminology l A relationship between elements of two sets such that no element of the first set is.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
2.1 Sets 2.2 Set Operations 2.3 Functions ‒Functions ‒ Injections, Surjections and Bijections ‒ Inverse Functions ‒Composition 2.4 Sequences and Summations.
FUNCTION Discrete Mathematics Asst. Prof. Dr. Choopan Rattanapoka.
Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.
February 12, 2015Applied Discrete Mathematics Week 2: Functions and Sequences 1Exercises Question 1: Given a set A = {x, y, z} and a set B = {1, 2, 3,
Chapter 3 Functions Functions provide a means of expressing relationships between variables, which can be numbers or non-numerical objects.
Functions. Copyright © Peter Cappello2 Definition Let D and C be nonempty sets. A function f from D to C, for each element d  D, assigns exactly 1 element.
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (2)
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Fall 2002CMSC Discrete Structures1 … and the following mathematical appetizer is about… Functions.
10/26/20151 … and the following mathematical appetizer is about… Functions.
Discrete Mathematics CS 2610 September 12, Agenda Last class Functions  Vertical line rule  Ordered pairs  Graphical representation  Predicates.
Functions Section 2.3 of Rosen Spring 2012 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions: Use Piazza.
MSU/CSE 260 Fall Functions Read Section 1.8.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
Example Prove that: “IF 3n + 2 is odd, then n is odd” Proof by Contradiction: -p = 3n + 2 is odd, q = n is odd. -Assume that ~(p  q) is true OR -(p 
Chapter 9 Functions Let A and B be nonempty sets. A function f from A to B, written f: A  B is a relation from A to B with the property that every element.
Functions Reading: Chapter 6 (94 – 107) from the text book 1.
Basic Structures: Functions Muhammad Arief download dari
CSE 2353 – October 1 st 2003 Functions. For Real Numbers F: R->R –f(x) = 7x + 5 –f(x) = sin(x)
Sets and Functions Contents  Set language  Basic knowledge on sets  Intervals  Functions (Mappings)
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Agenda Week 10 Lecture coverage: –Functions –Types of Function –Composite function –Inverse of a function.
CompSci 102 Discrete Math for Computer Science January 31, 2012 Prof. Rodger Slides modified from Rosen AB a b c d x y z.
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
Basic Structures: Sets, Functions, Sequences, and Sums.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
CSC102 - Discrete Structures Functions
FUNCTIONS COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
1 Discrete Mathematical Functions Examples.
Functions – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Functions Reading: Kolman, Section 5.1.
Functions CSRU1400 Spring 2008Ellen Zhang 1 CISC1400, Fall 2010 Ellen Zhang.
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 6 Dr.-Ing. Erwin Sitompul
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
Section 2.3. Section Summary  Definition of a Function. o Domain, Cdomain o Image, Preimage  One-to-one (Injection), onto (Surjection), Bijection 
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
FUNCTIONS.
Discrete Mathematics Lecture # 17 Function. Relations and Functions  A function F from a set X to a set Y is a relation from X to Y that satisfies the.
Functions 7/7/2016COCS - Discrete Structures1. Functions A function f from a set A to a set B is an assignment of exactly one element of B to each element.
Functions Goals Introduce the concept of function
Functions Section 2.3.
Relation and function.
… and the following mathematical appetizer is about…
Functions Section 2.3.
Discrete Math (2) Haiming Chen Associate Professor, PhD
CSE15 Discrete Mathematics 02/27/17
CS100: Discrete structures
… and the following mathematical appetizer is about…
Ch 5 Functions Chapter 5: Functions
Functions Rosen 6th ed., §2.3.
Properties of Functions
Functions Section 2.3.
Copyright © Zeph Grunschlag,
Presentation transcript:

Functions1 Elementary Discrete Mathematics Jim Skon

Functions2 §Definition: A function consists of three things: 1. A non empty set A, called the domain of the function 2. A non empty set B, called the codomain of the function 3. A rule that assigns to each element of A one and only one, element of B

Functions3 Function Notations §Use letters such as ƒ, g, and h to denote functions.  ƒ:A  B means ƒ is a function with domain A and codomain B  ƒ:A  B is read: "ƒ is a function from A to B” xf(x) AB f

Functions4 Function Notations  If ƒ:A  B, and a  A and b  B, and a is assigned to b by the function ƒ, then we say ƒ(a) = b §If ƒ(a) = b, then the element ƒ(a) or b is called the value of ƒ at a, or the image of a under the function ƒ. af(a)=b AB f

Functions5 Function Example §Let A = {1,2,3} and B = {a,b,c} Let ƒ(1) = b ƒ(2) = c ƒ(3) = a § c is the image of 2 under the function ƒ. § The image f(A) of function f is B = {a, b, c}

Functions6  In general, element a  A maps to element ƒ(a)  B.

Functions7 §From rule 3 of the definition, elements of the domain can map to at most one element of the codomain. §Multiple elements of the domain may map to the same element of the range:

Functions8 §The domain may not map to multiple elements of the range: §This is called the uniqueness condition of functions

Functions9 Function §.Formal Definition: l Let A and B be sets. A function ƒ:A  B is a subset of the Cartesian product A  B, which satisfies the uniqueness condition that, for all (a 1, b 1 )  ƒ and (a 2, b 2 )  ƒ, if a 1 = a 2, then b 1 = b 2.

Functions10 Function Examples: §Consider again A = {1,2,3} and B = {a,b,c} Let ƒ(1) = b ƒ(2) = c ƒ(3) = a ƒ = {(1, b), (2, c), (3, a) }

Functions11 Function Examples  Consider ƒ:R  R where R is reals Let ƒ(x) = x 2. Alternately: ƒ = {(x, x 2 ) | x  R} Then ƒ:R  R

Functions12 Function Examples  Let ƒ:N  N where ƒ(n) = n + 1 for all n  N Alternately :ƒ = {(n, n+1) | n  N }

Functions13 Function Examples  Let S be a finite non-empty set. We may define the function: ƒ: P (S)  N asƒ(A) = |A|. Alternately: ƒ = {(a, n) | a  P (S)  n  N  |a| = n} l This is the set size function.

Functions14 Function Examples  Consider the function ƒ:N  N  N N  N are pairs of natural numbers. Let ƒ(x,y) = x 2 + y ƒ = {((x,y), x 2 + y)}

Functions15 Function Examples  Consider a function ƒ: P (S)  P (S)  P (S) l where S = {1, 2, 3,..., 10} Let ƒ(A,B) = A  B ƒ = {((A, B), A  B) | A  S  B  S } §This is the union function

Functions16 Function Examples §Consider in general n-ary functions, which are of the form ƒ:A 1  A 2...  A n  B. §These are called n-ary functions or functions of n variables, and are written: ƒ(a 1, a 2,..., a n ) = b

Functions17 Function Examples  Consider a function ƒ:N  N  N  N  I Let ƒ(w, x, y, z) = 2w + 3(xy) - 4z ƒ = {( (w, x, y, z), 2w + 3(xy) - 4z) }

Functions18 Function Examples  Consider a function ƒ:A  B  N A = {x | x is a MVNC basketball player} B = {x | x is a MVNC basketball game (date)} Let ƒ(x, y) = points scored by player x in game y

Functions19 Function Examples  Consider a function ƒ:A  B  N A = {x | x is a first names} B = {x | x is a last name} Let ƒ(x, y) = student x y’s box number. §Not a function! Why?

Functions20 Function Examples  Consider function ƒ:R  I where: ƒ(x) = Largest integer less than or equal to x. ƒ(x) =  x  §called the floor function.  Consider function ƒ:R  I where: ƒ(x) = Least integer greater than or equal to x. ƒ(x) =  x  §called the ceiling function.

Functions21 Function Range §Range Definition: Let ƒ:A  B be a function from A (domain) to B (codomain). The range of ƒ is the set of all elements of B that are mapped to by some element of A, i.e. range(ƒ) = {b  B | b = ƒ(a) for some a  A} l In other words, the range of ƒ is the subset of B which the function actually maps to.

Functions22 Surjective (onto) Function §Let B be the codomain of function ƒ. §If range(ƒ) = B, then we say that the function is onto B  A function ƒ:A  B is surjective if it is onto B. §In other words, a function is surjective if every element in the codomain is mapped to.

Functions23 Surjective Function ABRange(f) A BRange(g) g f Not onto Onto f:A  B g:A  B

Functions24 Surjective Function §Which of the previous examples are surjective?

Functions25 Surjective Function  Formally ƒ is surjective if and only if  b  a  ƒ (a) = b. or  b  a  (a, b)  ƒ

Functions26 Injective Function  Definition: Let ƒ:A  B. If no two different elements of A are assigned to the same element of B by the function ƒ, the function is one-to-one.  More formally if  a 1  A:  a 2  A: ƒ(a 1 ) = ƒ(a 2 )  a 1 = a 2 Then the function is one-to-one. Contrapositively:  a 1  A:  a 2  A:a 1  a 2  ƒ(a 1 )  ƒ(a 2 )

Functions27 Injective Function AB g f Not one to one One to one f:A  B g:A  B f(a 1 ) a1a1 a2a2 a3a3 a4a4 a5a5 a6a6 f(a 2 ) f(a 3 ) f(a 4 ) f(a 5 ) f(a 6 ) AB f(a 1 ) a1a1 a2a2 a3a3 a4a4 a5a5 a6a6 f(a 2 ) f(a 3 )= f(a 4 ) f(a 5 ) f(a 6 ) f(a 7 )

Functions28 Injective functions: §If a function is one-to-one then it is injective. §Which of the previous examples are injective?

Functions29 Example  Let ƒ:N  N be defined by: l ƒ(n) = n 2 l Is this surjective? injective?  Let ƒ:I  N be defined by: l ƒ(n) = n 2 l Is this surjective? injective?

Functions30 Bijective Function §Definition - bijective function If a function is both surjective and injective then it is bijective. A bijective function is onto and one-to-one. A bijective function is simply a one-to-one correspondence

Functions31 Bijective Function  A function ƒ:A  B is bijective if and only if  b  B:  !a  A:ƒ(a) = b §Which of the previous examples are bijective?

Functions32 Function Composition  Let ƒ:A  B and g:B  C §We can now define a new function, g  f, by the formula: (g  f)(a) = g(ƒ(a)) §This is called the composition function of g with ƒ.

Functions33 Function Composition

Functions34 Function Composition Example  Let A = {x, y, z} B = {2, 4, 6, 8} C = {  }  Let ƒ:A  B be defined by: ƒ(x) = 2,ƒ(y) = 8, ƒ(z) = 4  Let g:B  C be defined by: g(2) = ,g(4) = , g(6) =  g(8) =   Then g  ƒ:A  C is the function: (g  ƒ)(x) = (g( ƒ(x)) = g(2) =  (g  ƒ)(y) = (g( ƒ(y)) = g(8) =  (g  ƒ)(z) = (g( ƒ(z)) = g(4) = 

Functions35 Function Composition Example  Let ƒ:R  R be defined by: ƒ(x) = 2x  Let g:R  R be defined by: g(x) = 3x - 1 §Then g  ƒ:(x) = g( ƒ(x)) = g(2x 2 + 4) = 3(2x 2 + 4) - 1 = 6x = 6x What is ƒ  g:(x)?

Functions36 Function Composition Example  Let S be a finite set and x  S. We can define: ƒ: P (S)  P (S  {x}) as the function: ƒ(T) = T  {x},where T  S (or T  P (S) )  Let g: P (S  {x})  N be the function: g(V) = |V|, where V  S  {x} (or V  P (S  {x}) )

Functions37 Function Composition Example §Then the composition: g  ƒ: P (S)  N is given by (g  ƒ)(T) = (g( ƒ(T)) = g(T  {x}) = |T  {x}| = |T| + 1

Functions38 Function Composition §In general the composition of functions is not communitive, §e.g. ƒ  g  g  ƒ. §In fact, if ƒ  g is possible, g  ƒ is usually not possible!

Functions39 Function Composition § For g  ƒ to be possible, f must have a codomain which is a subset of the domain of g. If ƒ:A  B and g:C  D, then B  C. A CB g g:C  D f D f:A  B

Functions40 Function Composition §Likewise, for ƒ  g to be possible, g must have a codomain which is a subset of the domain of f, e.g. If ƒ:A  B and g:C  D, then D  A. C AD f g:C  D g B f:A  B

Functions41 Function Composition  Thus for both ƒ  g & g  ƒ to exist, B  C and D  A ACB g g:C  D f D f:A  B

Functions42 INVERSE of Functions  If ƒ:A  B is a bijection, then it is possible to define a function g:B  A with the property: l If ƒ(a) = b then g(b) = a AB g:B  A f:A  B

Functions43 INVERSE of Functions §Such a function g is called the inverse function of ƒ. §It is denoted by the symbol ƒ -1. AB f -1 :B  A f:A  B If ƒ(a) = b then f -1 (b) = a

Functions44 Example  Let A = {1,2,3} and B = {a,b,c}. Let ƒ:A  B be defined by: ƒ(1) = c, ƒ(2) = a, ƒ(3) = b Then the inverse ƒ -1 :B  A is defined by: ƒ -1 (a) = 2, ƒ -1 (b) = 3, ƒ -1 (c) = cabcab AB f cabcab AB f -1

Functions45 INVERSE of Functions  The the function ƒ:A  B has an inverse ƒ -1 :B  A if and only if it is bijective. §WHY??

Functions46 INVERSE of Functions §Note that in general ƒ -1  ƒ(a) = a, for all a in the domain of ƒ ƒ  ƒ -1 (b) = b, for all b in the codomain of ƒ

Functions47 Function Images §Consider a function:  :N  N, where  (x) =2x §The range of the function is: {0, 2, 4, 6, 8,... }

Functions48 Function Images §We can also consider the image of the function over a subset of the domain. §Let A = {2, 3, 4, 5, 6}.  (A) is the the image of function  over set A, which is:  (A) = {4, 6, 8, 10, 12} §If B = {x | 4 < x  10} then  (B) = {10, 12, 14, 16, 18, 20}

Functions49 Function Images §Image of a function - the elements mapped to over a given subset  Consider ƒ:R  R, f(x) = 2x l f(R) = Range(R) = R (The range of f). l f(I) = I l Let A = {1, 4, 6, 9). Then f(A) = {2, 8, 12, 18} l f(N) = ? l f(R - ) = I

Functions50 Function Images §Definition: l Let  be a function from set A to set B and let S be a subset of A (e.g. S  A). l The image of S is the subset of B that consists of the images of the elements of S. l The image of S is denoted  (S), thus:  (S) = {  (S) | s  S}

Functions51 Function Images §Consider:  :R  R, where  (x) =  (x+1)/2  If S = {1, 3, 5, 7, 9}, what is  (S)? If S = {x | 3  x  6}, what is  (S)? What is  (N)? What if  (Z)?

Functions52 Example §Consider on page 70