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,

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
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.
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!
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.
Functions.
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.
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,
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.
ICS 253: Discrete Structures I
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.
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,
Functions1 Elementary Discrete Mathematics Jim Skon.
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl Module #4.
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)
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.
Basic Structures: Sets, Functions, Sequences, and Sums.
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.
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
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 Section 2.3.
Applied Discrete Mathematics Week 2: Functions and Sequences
Functions.
… and the following mathematical appetizer is about…
Functions.
Functions Section 2.3.
Discrete Math (2) Haiming Chen Associate Professor, PhD
Functions.
CSE15 Discrete Mathematics 02/27/17
CS100: Discrete structures
… and the following mathematical appetizer is about…
Functions CS 202 Epp section 7.1.
CS 220: Discrete Structures and their Applications
Functions.
ICS 253: Discrete Structures I
… and the following mathematical appetizer is about…
Functions Rosen 6th ed., §2.3.
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Properties of Functions
Functions Section 2.3.
Presentation transcript:

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, 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 Examples Let A = {x, y, z} and B = {1, 2, 3}

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 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 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 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 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 (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 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 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 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 Suppose n = x = y If x = y then x = y 2 + 1, and x 2 = y 2 But, for example, -2 2 = 2 2 So f is not one-to-one

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 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 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 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 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 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 Example Find f o g and g o f where f:R  R = f(x) = x and g:R  R = g(x) = x + 2 f o g = f(g(x)) = f(x+2) = (x+2) = x 2 + 4x + 5 g o f = g(f(x)) = g(x 2 + 1) = (x 2 + 1) + 2 = x 2 + 3

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 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 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 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 Since we can’t transmit anything smaller than a byte, we use the ceiling function to find the closest usable whole number:   = 1416

23 Section 1.6 Functions -ends-