Discrete Maths Objectives to show the connection between relations and functions, and to introduce some functions with useful, special properties 242-213,

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

© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Manish Kumar PRE. 1 Theory Of Computation Pre-requisite.
Functions Section 2.3 of Rosen Fall 2008
Quiz April Sections 1.6,1.7,1.8. Quiz: Apr. 21 ’05: pm 1. Consider the following sets: Provide the following sets using set-builder.
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
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,
February 5, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Homework Solution PQ  (P  Q) (  P)  (  Q)  (P  Q)  (  P)  (  Q) truetruefalsefalsetrue.
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.
Discrete Structures Functions Dr. Muhammad Humayoun Assistant Professor COMSATS Institute of Computer Science, Lahore.
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.
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,
My Introduction Name: Prakash ADHIKARI Academic Qualification: Master’s Degree Research, Universite Lumiere-IUT Lumiere, Lyon - 2(ULL-2), France Master’s.
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.
Discrete Maths Objective to introduce relations, show their connection to sets, and their use in databases , Semester 2, Relations.
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.
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.
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.
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
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 
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)
Agenda Week 10 Lecture coverage: –Functions –Types of Function –Composite function –Inverse of a function.
Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and.
MAT 2720 Discrete Mathematics Section 3.1 Functions
Fall 2003CMSC Discrete Structures1 … and now for something completely different… Set Theory Actually, you will see that logic and set theory are.
Functions Discrete Structure. L62 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.
Temperature Readings The equation to convert the temperature from degrees Fahrenheit to degrees Celsius is: c(x) = (x - 32) The equation to convert the.
CSC102 - Discrete Structures Functions
1 Functions CS 202 Epp section ??? Aaron Bloomfield.
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.
1 Discrete Mathematical Functions Examples.
Functions CSRU1400 Spring 2008Ellen Zhang 1 CISC1400, Fall 2010 Ellen Zhang.
Review Functions. Function A function is a special type of relation in which each element of the domain is paired with exactly one element of the range.
Ch02-Basic Structures: Sets, Functions, Sequences, Sums, and Matrices 1.
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.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
Discrete Mathematics Functions
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.
Applied Discrete Mathematics Week 2: Functions and Sequences
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Functions.
Chapter 2 Sets and Functions.
… and the following mathematical appetizer is about…
Functions.
Discrete Math for Computer Science CSC 281
CS201: Data Structures and Discrete Mathematics I
Functions.
… and the following mathematical appetizer is about…
Functions.
Functions.
Ch 5 Functions Chapter 5: Functions
… and the following mathematical appetizer is about…
Functions Rosen 6th ed., §2.3.
Applied Discrete Mathematics Week 3: Sets
Properties of Functions
Functions.
Functions Section 2.3.
Presentation transcript:

Discrete Maths Objectives to show the connection between relations and functions, and to introduce some functions with useful, special properties , Semester 2, Functions 1

1. What is a Function? A function is a special kind or relation between two sets: f : A  B 2 A f B domaincodomain All the elements in A have a single link to a value in B All the elements in A have a single link to a value in B Some elements in B may not be used. Some may be used more than once. Some elements in B may not be used. Some may be used more than once. read this as f maps A to B; it is NOT if-then read this as f maps A to B; it is NOT if-then

Example The function f: P  C with P = {Linda, Max, Kathy, Peter} C = {Hat Yai, NY, Hong Kong, Bangkok} Usual function notation: f(Linda) = Hat Yai f(Max) = Hat Yai f(Kathy) = Hong Kong f(Peter) = Bangkok 3 Linda Max Kathy Peter Bangkok Hong Kong NY Hat Yai P C f

The range is the set of elements in B used by the function f. 4 the range Range A f B

2. Functions with Special Properties Function Image One-to-one Function (injective) Onto Function (surjective) One-to-one Correspondence (bijective) Identity Function Inverse Function 5

2.1. Function Image, f(S) 6 A f B For some subset of A (e.g. S), the set of f() values in B are its Function Image f(S). For some subset of A (e.g. S), the set of f() values in B are its Function Image f(S). S  A f(S)

2.2. One-to-one Function 7 also called injective also called injective A f B Each value in A maps to one value in B. Don’t need to use all the B values.

Examples 8 f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = Boston Is f one-to-one? No, Max and Peter are mapped onto the same element of the image g(Linda) = Moscow g(Max) = Boston g(Kathy) = Hong Kong g(Peter) = New York Is g one-to-one? Yes, each element is assigned a unique element of the image

2.3. Onto Function 9 also called surjective also called surjective A f B Every element in B is linked to from A. Some elements in B may be used more than once.

2.4. One-to-one Correspondence 10 also called bijective also called bijective A f B Each value in A maps to one value in B and every element in B is linked to from A. Each value in A maps to one value in B and every element in B is linked to from A. bijective == injective + surjective

Is f injective? No Is f surjective? No Is f bijective? No. 11 Example 1 Linda Max Kathy Peter Boston New York Hong Kong Moscow f injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B

Is f injective? No Is f surjective? Yes Is f bijective? No 12 Example 2 Linda Max Kathy Peter Boston New York Hong Kong Moscow f Paul injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B

Is f injective? Yes Is f surjective? No Is f bijective? No 13 Example 3 injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck

Is f injective? No! f is not even a function 14 Example 4 injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck

Is f injective? Yes Is f surjective? Yes Is f bijective? Yes 15 Example 5 injective: 1-1; not all B surjective: all B bijective 1-1; all B injective: 1-1; not all B surjective: all B bijective 1-1; all B Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck bijective == injective + surjective Paul

2.5. Identity Function f : X  X is called the identity function (I x ) if every element in X is mapped to the same element e.g : Z : f(x) = x * 1 f

2.6. Inverse Function 17 Linda Max Kathy Peter Boston New York Hong Kong Moscow f Lubeck Paul Linda Max Kathy Peter Boston New York Hong Kong Moscow f -1 Lubeck Paul example 5 If f is bijective then we can create an inverse function, f -1 if f(x) = y then f -1 (y) = x

18 f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = Lübeck f(Paul) = New York f -1 (Moscow) = Linda f -1 (Boston) = Max f -1 (Hong Kong) = Kathy f -1 (Lübeck) = Peter f -1 (New York) = Paul Inversion is only possible for bijective functions.

3. Composition of Functions if g: X  Y and f: Y  Z then f  g: X  Z read  as “first do g then do f” The composition of f and g is defined as: (f  g)(x) = f( g(x) ) this is why f and g are ordered this way 19

Diagram f  g is only possible if the range of g is a subset of the domain of f 20 X Y Z g f f  g f’s domain g’s range

Example f(x) = 7  x – 4, g(x) = 3  x (f  g)(5) = f( g(5) ) = f(15) = 105 – 4 = 101 In general: (f  g)(x) = f( g(x) ) = f(3  x) = 21  x

Composition and Inverse (f -1 ○ f)(x) = f -1 (f(x)) = x The composition of a function and its inverse is the identity function i x 22

4. More Information Discrete Mathematics and its Applications Kenneth H. Rosen McGraw Hill, 2007, 7th edition chapter 2, section