Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.

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.
Discrete Mathematics Lecture 7 Alexander Bukharovich New York University.
1 Discrete Math CS 2800 Prof. Bart Selman Module Basic Structures: Functions and Sequences.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between sets Types of function.
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,
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
Functions.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
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.
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
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.
Mathematics. Session Set, Relation & Function Session - 3.
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,
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
ICS 253: Discrete Structures I
Week 7 - Friday.  What did we talk about last time?  Set disproofs  Russell’s paradox  Function basics.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
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.
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,
Functions1 Elementary Discrete Mathematics Jim Skon.
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.
Basic Structures: Functions Muhammad Arief download dari
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.
Discrete Mathematics Relation.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
MATH 224 – Discrete Mathematics
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Introduction to Real Analysis Dr. Weihu Hong Clayton State University 8/27/2009.
Basic Structures: Sets, Functions, Sequences, and Sums.
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
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.
Temperature Readings The equation to convert the temperature from degrees Fahrenheit to degrees Celsius is: c(x) = (x - 32) The equation to convert the.
CSNB 143 Discrete Mathematical Structures
Chapter 7 – Radical Equations and Inequalities 7.2 – Inverse Functions and Relations.
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.
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 Functions
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Relations, Functions, and Matrices
CS 2210:0001 Discrete Structures Sets and Functions
MATH 224 – Discrete Mathematics
Chapter 2 Sets and Functions.
Relation and function.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive,
Functions Section 2.3.
CS201: Data Structures and Discrete Mathematics I
Inverse Functions 5.3 Chapter 5 Functions 5.3.1
CSE15 Discrete Mathematics 02/27/17
Foundations of Discrete Mathematics
Functions.
Ch 5 Functions Chapter 5: Functions
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Functions Section 2.3.
Foundations of Discrete Mathematics
Presentation transcript:

Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.

Function  A function from a set A to a set B is a binary relation f from A to B with the property that,  For every a  A, there is exactly one b  B such that (a, b)  f.

Function  A function f can see as a subset of A x B with the property that for each a  A,  there is just one pair (a, b) in f having first coordinate a.

Function  If A = {1, 2, 3}, B = {x, y}, and f={(1,x), (2, y), (3,x)}, then f is just the rule that associates x with 1, y with 2, and x with 3.

Function: Key Points 1.Every a in A must be the first coordinate of an ordered pair in the function.  A = {1, 2, 3} and B = {x, y}, the set g={(1,x),(3,y)} is not a function from A to B.  g contains no ordered pair with first coordinate 2.

Function: Key Points 2. Each element of A must be the first coordinate of exactly one ordered pair (no repetition).  A = {1, 2, 3} and B = {x, y}, the set h={(1,x),(2,x),(3,y),(2,y)} is not a function from A to B.  2 is the first coordinate of two pairs.

Function: Example 1  Suppose A is the set of surnames of people listed in the Salt Lake City telephone directory f = {(a, b)| a is on page n} is a function from A to the set of natural numbers?

Function: Example 1  By definition of f, each element of A is the first coordinate of a pair in f, so  Some surnames are undoubtedly listed on a number of different page.  f is not a function.

Function  f is a function from A to B,  each b  B, which is uniquely determined by the element a  A,  b is denoted f(a) and called the image of a. (a, b)  f if and only if b = f(a).

Function Notation f : A → B  It means that f is a function from A to B.  A and B are sets.

Function Notation f : a  It means that f(a) = b  a and b are elements. b

Function Notation f = { (1, x), (2, y), (3, x)} could be described by 1 f: 2 3 xyzxyz

Function Notation f = x 2 f : R →R that associates with any x  R, its square x 2 ; that is, x x 2 f = { (x, x 2 ) | x  R}  as a binary relation.

Functions Let f : A → B be a function from A to B.  The domain of f (dom f) is the set A.  The target of f is the set B.

Functions Let f : A → B be a function from A to B.  The range or image of f (rng f) is rng f ={b  B| (a, b)  f for some a  A} ={b  B| b = f(a) for some a  A}

Onto Function  A function is onto or surjective if its range is the target, rng f = B  every b  B is of the form b = f (a) for some a  A

Onto Function  For any b  B, the equation b = f(x) has a solution a  A.

One-to-One Function A function is one-to-one (1-1) or injective if and only if different elements of A have different images.  a 1 ≠ a 2 → f(a 1 ) ≠ f(a 2 )  If f(a 1 ) = f(a 2 ), then a 1 = a 2

Bijective Function A function is bijection or bijective if it is both  one-to-one and  onto.

One-to-One Function If f(a 1 ) = f(a 2 ), then a 1 = a 2 a 1 ≠ a 2 → f(a 1 ) ≠ f(a 2 )

Example : Discrete Function A={1, 2, 3, 4}, B ={x, y, z} and f = {(1,x),(2,y), (3, z), (4, y)} The f is a function A → B Domain: A and target: B rng f = {x, y, z} = B, f is onto f(2) =f(4) = y but 2 ≠ 4, f is not one-to-one

Example : Discrete Function A={1, 2, 3}, B ={x, y, z, w} and f = {(1,w),(2,y), (3, x)} The f is a function A → B Domain: A and target: B rng f = {x, y, w} ≠ B, f is not onto f(1) ≠ f(2) ≠ f(3), f is one-to-one

Example : Discrete Function A={1, 2, 3}, B ={x, y, z} and f = {(1,z),(2,y), (3, y)} and g = {(1,z), (2,y), (3,x)} f and g are functions A → B dom f = dom g = A and target B rng f = {z, y} ≠ B, f is not onto rng g = {z, y, x} = B, g is onto

Example : Discrete Function A={1, 2, 3}, B ={x, y, z} and f = {(1,z),(2,y), (3, y)} and g = {(1,z), (2,y), (3,x)} f and g are functions A → B f(2) = f(3), 2 ≠ 3, f is not one-to-one g(1) ≠ g(2) ≠ g(3), g is one-to-one

Example : Discrete Function Let f: Z → Z by f(x)= 2x – 3 dom f = Z and target Z To find rng f, note that b rng f ↔ b = 2a – 3 for some integer a ↔ b = 2a – 3 – ↔ b = 2(a – 2) + 1 for some integer a  if and only if b is odd.

Example : Discrete Function Let f: Z → Z by f(x)= 2x – 3 dom f = Z and target Z The range of f is the set of odd integers f ≠ Z, f is not onto b rng f ↔ b = 2a – 3  if and only if b is odd.

Example : Discrete Function Let f: Z → Z by f(x)= 2x – 3 dom f = Z and target Z f is one-to-one. if f(x 1 ) = f(x 2 ), then 2x 1 – 3 = 2x 2 – 3 and x 1 = x 2

Example : Discrete Function Let f: N → N by f(x)= 2x – 3 f(1) = 2(1) – 3 = -1 and -1  N Hence, no function has been defined.

Problem about a Function Define f: Z → Z by f(x)= x 2 – 5x +5 Determine whether f is one-to-one and/or onto. Consider f(x 1 ) = f(x 2 ) x 1 2 – 5x = x 2 2 – 5x x 1 2 – x 2 2 = 5x 1 – 5x – 5 (x 1 – x 2 ) (x 1 + x 2 ) = 5(x 1 – x 2 )

Problem about a Function Define f: Z → Z by f(x)= x 2 – 5x +5 (x 1 – x 2 ) (x 1 + x 2 ) = 5(x 2 – x 1 ) (x 1 + x 2 ) = 5 There are solutions with x 1 ≠ x 2. Any x 1, x 2 satisfying x 1 + x 2 = 5

Problem about a Function Define f: Z → Z by f(x)= x 2 – 5x +5 (x 1 + x 2 ) = 5 x 1 = 2, x 2 =3, x 1 + x 2 = 5 Since f(2) = f(3) = -1, f is not one-to-one

Problem about a Function Define f: Z → Z by f(x)= x 2 – 5x +5 f(x)= x 2 – 5x +5, x  R,  is a parabola with vertex (5/2, -5/4)  any integers < -1 is not in rng f  0 is not in rng f because x 2 – 5x +5 = 0 has not integer solutions. f is not onto.

The Identity Function For any set A, the identity function on A is the function  A : A → A defined by  A (a) = a for all a  A. In terms of ordered pairs  A = {(a, a) | a  A }  A is read “yota sub A”

The Identity Function The identity function on a set A is one-to-one If (a 1 ) = (a 2 ), then a 1 = a 2, [(a 1 ) = a 1 and (a 2 ) = a 2 ], so  is one-to-one

The Identity Function The identity function on a set A is onto the equation a = (x) has a solution for any a. If x = a, then (x) = (a) = a so  is onto

The Absolute Value Function The absolute value of a number x, denoted |x|, is defined by x if x ≥ 0 |x|= -x if x < 0

The Absolute Value Function The domain R and range [0, ) = {y  R | y ≥ 0}. It is not one-to-one For example |2| = |-2|

The Floor Function For any real number x, the floor of x, written x, is the greatest integer less than or equal to x, that is, the unique integer x satisfying x – 1 < x  x

The Floor Function x – 1 < x  x 2.01 = 2, 15 = 15, 1.99 = 1, -2.01 = -3

The Ceiling Function For any real number x, the ceiling of x, written x, is the least integer greater than or equal to x, that is, the unique integer x satisfying x  x < x + 1

The Ceiling Function x  x < x + 1 2.01 = 3, 15 = 15, 1.99 = 2, -2.01 = -2

The Inverse of a Function A function f: A → B has an inverse if and only if the set obtained by reversing the ordered pairs of f is a function B → A.

The Inverse of a Function If f: A → B has an inverse, the function f -1 = {(a, b) | (a, b)  f} is called the inverse of f.

The Inverse of a Function If f: A → B has an inverse, then f -1 has an inverse that is f ( f -1 ) -1 = f is called the inverse of f. If A= {1, 2, 3, 4} and B = {x, y, z, t} f ={(1, x), (2, 2), (3, z), (4, t)} f -1 ={(x,1), (y, 2), (z, 3), (4, t)}

The Inverse of a Function A function f: A → B has an inverse, B → A if and only if f is one-to-one and onto.

The Inverse of a Function For any function g  (x, y)  g  y = g(x) (b, a)  f -1  a = f -1 (b) a= f -1 (b) ↔ (b, a)  f -1 ↔ (a, b)  f ↔ b = f(a) a= f -1 (b) if and only if f(a) = b a= f -1 (b) ↔ f(a) = b

The Inverse of a Function Example 1, For f,  = f -1 (-7), then f() = 7 Example 2, For f, f(4) = 2, then 4 = f -1 (2)

The Inverse of a Function If: R → R is defined by f(x) = 2x – 3 is one-to-one and onto, so an inverse function exists. if y = f -1 (x), then x = f(y) = 2y – 3 Thus, y = ½(x + 3) = f -1 (x)

The Inverse of a Function Let A = {x  R | x  0}, B = {x  R | x ≥ 0}, and define f: A → B by f(x) = x 2 This squaring function with domain restricted so that is one-to-one as well as onto. Since f is one-to-one and onto, it has an inverse.

The Inverse of a Function f: R → R + by f(x) = 3 x is one-to-one and onto. Find the f -1 (x) y = f -1 (x) f(y) = x 3 y = x y = log 3 x f -1 (x) = log 3 x

The Inverse of a Function Let A = {x| x ≠ ½ } define f: A → R by f(x) = 4x / (2x – 1) is one-to-one? Suppose f(a 1 ) = f(a 2 ), then 4a 1 / (2a 1 – 1) = 4a 2 / (2a 2 – 1) 8a 1 a 2 – 4a 1 = 8a 1 a 2 – 4a 2 – 4a 1 = – 4a 2 so f is one-to-one.

The Inverse of a Function Let A = {x| x ≠ ½ } define f: A → R by f(x) = 4x / (2x – 1) Find rng f y  rng f ↔ y = f(x) for some x  A ↔ there is an x  A | y = 4x / (2x – 1) ↔ there is an x  A | 2xy – y = 4x ↔ there is an x  A | x(2y – 4) = y x = y/(2y – 4)

The Inverse of a Function A = {x| x ≠ ½ } x = y/(2y – 4), x ≠ ½, x  A y  rng f  y ≠ 2, so rng f = B = {y  R| y ≠ 2} f(x) = 4x / (2x – 1)

Let A = {x| x ≠ ½ } define f: A → R by f(x) = 4x / (2x – 1) Find the inverse Also, dom f -1 = rng f = B rng f -1 = dom f = A x = f(y) = 4y/(2y -1) f -1 (x) = y = x / (2x – 4 ) f: A → B is one-to-one and onto. It has an inverse f -1 :B → A

The Inverse of a Function Let A = {x  R | x  0}, B = {x  R | x ≥ 0}, f(x) = x 2, find the f -1 (x) y = f -1 (x) f(y) = x y 2 = x y = x x = f(y), y  A, so y  0 y = -x, f -1 (x) = -x

The Inverse of a Function If f: A → B is one-to-one and onto, then f -1 : B → A is also one-to-one and onto.

Composition of Functions g ° f: A → C defined by (g ° f) (a) = g (f (a)) for all a  A If f: A → B and g: B → C are functions, then the composition of g and f is the function g ° f: A → C

Composition of Functions (g ° f) (a) = g(f(a)) = g(x) = u (g ° f) (b) = g(f(b))= g(y) = w (g ° f) (c) = g(f(c))= g(x) = u If A={a, b, c}, B={x, y}, and C = {u, v, w}, and if f: A → B and g: B → C are functions f = {(a, x), (b, y), (c, x)}, g = {(x, u), (y, w)}

Composition of Functions (g ° f) = {(a, u), (b, w), (c, u)} If A={a, b, c}, B={x, y}, and C = {u, v, w}, and if f: A → B and g: B → C are functions f = {(a, x), (b, y), (c, x)}, g = {(x, u), (y, w)}

Composition of Functions (g ° f)(x)= g(f(x)) = g(2x – 3) = (2x – 3) (f ° g) (x) = f(g(x))= f(x 2 + 1) = 2(x 2 + 1) – 3 (g ° f) ≠ (f ° g) If f and g are the functions R → R defined by f(x) = 2x – 3 g(x) = x 2 + 1

Composition of Functions In the definition of g ° f, it is required that rng f  B = dom g.

Equality of Functions Functions f and g are equal if and only if they have the same domain, the same target, and f (a) = g (a) for every a in the common domain.

Compositions of Functions Function f: A → B and g: B → A are inverses if and only if g ° f =  A and f ° g=  B if and only if g(f(a)) = a and f(g(b)) = b  a  A and  b  B

Compositions of Functions Show that the functions f: R → (1, ) and g: (1, ) → R defined by f(x) = 3 2x + 1 and g(x) = ½ log 3 (x – 1 ) are inverses

Compositions of Functions f: R → (1, ), f(x) = 3 2x + 1 g: (1, ) → R, g(x) = ½ log 3 (x – 1 ) For any x  R, (g ° f) (x) = g (f (x)) = g(3 2x + 1) = ½ (log 3 [(3 2x + 1) – 1 ]) = ½ (log 3 3 2x ) = ½ (2x) = x

Compositions of Functions f: R → (1, ), f(x) = 3 2x + 1 g: (1, ) → R, g(x) = ½ log 3 (x – 1 ) For any x  R  (1, ) (f ° g)(x) = f(g(x)) = f( ½ log 3 (x – 1) = 3 2 ½ log3(x – 1) + 1 = 3 log3(x – 1) + 1 = (x – 1 ) + 1 = x

Compositions of Functions Conclusion: f(x) = 3 2x + 1 and g(x) = ½ log 3 (x – 1 ) are inverses because of g ° f =  A and f ° g=  B  g(f(a)) = a and f(g(b)) = b

Finite and Infinite Set A finite set is a set that is either empty or in one-to-one correspondence with the set {1, 2, …, n} of the first n natural numbers, for some n  N. A set that is not finite is called infinite.

Cardinality The cardinality of the empty set to be 0 and write ||= 0. If A is nonempty finite set and in one-to- one correspondence with {1, 2, …, n}, we define the cardinality of A to be n and write |A| = n.

Cardinality If A is nonempty finite set, its elements can be labeled a 1, a 2, …, a n for some n and the cardinality of A is n, the number of elements in A.

Cardinality  |{a, b, x}| = 3  |{a, b}| = 2  The letters of the English alphabet comprise a set of cardinality 26  |{x  R| x = 0} | = 0  || = 0

Cardinality  Sets A and B have the same cardinality and we write |A| = |B|,  If and only if there is a one-to-one correspondence between them,  there exists a one-to-one onto function from A to B (or from B to A).

Cardinality  |{a, b}| = |{x, y}|  Z and 2Z have the same cardinality  Any two intervals of real numbers – open, closed, finite, infinite- have the same cardinality.

Cardinality  R and R + have the same cardinality For f: R → R + defined by f(x) = 2 x establishes a one-to-one correspondence.

Countably  A set A is countably infinite if and only if |A| = |N|  A set A is countable if and only if it is either finite or countably infinite.  A set that is not countable is uncountable.

Countably  The symbol  0 (“aleph naught”) has been used to denote the cardinality of the natural numbers.  A countable infinite set has cardinality  0.

Countably  A subset of a countable set is countable.  The concept of same cardinality is an equivalence relation on sets, in particular, it is transitive.

Countably  Prove that the notion of same cardinality is an equivalence relation on the family of all sets.

Countably  Reflexivity: For any set A,  A is one-to- one function A  A,  so A has the same cardinality as itself.

Countably  Symmetry: If A and B have the same cardinality, then there is a one-to-one onto function f: A  B.  a function has an inverse f -1 : B  A which is one-to-one and onto,  so B and A have the same cardinality.

Countably  Transitivity: Suppose A, B and C are sets such that A and B have the same cardinality and B and C have the same cardinality.  There is a one-to-one function and onto function f: A  B and a one to-one onto function g: B  C.

Topics covered  Functions. Basic Terminology.  Inverses and Composition.  One-to-one correspondence and the Cardinality of a Set.

Reference  “Discrete Mathematics with Graph Theory”, Third Edition, E. Goodaire and Michael Parmenter, Pearson Prentice Hall, pp