1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.

Slides:



Advertisements
Similar presentations
Functions Section 2.3 of Rosen Fall 2008
Advertisements

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.
CSE115/ENGR160 Discrete Mathematics 02/21/12
Functions Goals Introduce the concept of function Introduce injective, surjective, & bijective functions.
CS104 : Discrete Structures Chapter II Fundamental Structures.
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,
RMIT University; Taylor's College
Functions.
Functions, Sequences, and Sums
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.
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,
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
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.
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.
321 Section, Week 3 Natalie Linnell. Functions A function from A to B is an assignment of exactly one element of B to each element of A. We write f(a)
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
CSE 2353 – October 1 st 2003 Functions. For Real Numbers F: R->R –f(x) = 7x + 5 –f(x) = sin(x)
Chapter 5 – Relations and Functions. 5.1Cartesian Products and Relations Definition 5.1: For sets A, B  U, the Cartesian product, or cross product, of.
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.
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 (Mappings). Definitions A function (or mapping)  from a set A to a set B is a rule that assigns to each element a of A exactly one element.
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.
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.
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
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Functions Section 2.3.
Applied Discrete Mathematics Week 2: Functions and Sequences
Functions.
Relation and function.
Functions.
Functions Section 2.3.
Functions.
CSE15 Discrete Mathematics 02/27/17
CS100: Discrete structures
Functions.
Ch 5 Functions Chapter 5: Functions
… and the following mathematical appetizer is about…
Continuity Alex Karassev.
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Functions Section 2.3.
Presentation transcript:

1 Lecture 5 Functions

2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit

3 Function Definition 32 Let A and B be nonempty sets. A function f from a set A to a set B is a relation that assigns to each element a in the set A exactly one element b in the set B. The set A is the domain (or set of inputs) of the function f, and the set B contains the range (or set of outputs).

4 Example

5 Definition 33 Suppose f is a function from A to B, if a  A, b  B, and f(a)=b, we say that b is the image of a and a is the preimage of b.

6 Introduction f a b=f(a) A B f The function f maps A to B b is image of a under function f a is pre-image of b under function f

7 Example f(a) = Z the image of d is Z the domain of f is A = {a, b, c, d} the range is {Y, Z} f(a) = {Z} the preimage of Y is b the preimages of Z are a, c and d

8 Function as graph We can represent a function mapping pairs (a, f(a)) in a graph. A pair becomes a point in the graph space. By connecting the points in a graph, it becomes line.

9 Function as graph Range/Julat domain

10 Characteristics of a function from set A to set B Each element of A must be matched with an element of B. Some elements of B may not be matched with any element of A. Two or more elements of A may be matched with the same element of B. An element of A (the domain) cannot be matched with two different elements of B.

11 Representations of Functions The graph of a function is a curve in the xy-plane. But the question arises: Which curves in the xy-plane are graphs of functions? This is answered by the following test.

12 Representations of Functions If each vertical line x = a intersects a curve only once, at (a, b), then exactly one functional value is defined by f (a) = b. But if a line x = a intersects the curve twice, at (a, b) and (a, c), then the curve can’t represent a function because a function can’t assign two different values to a.

13 Which is and which is not a function?

14 Algebraic Functions A function f is called an algebraic function if it can be constructed using algebraic operations (such as addition, subtraction, multiplication, division, and taking roots) starting with polynomials. Any rational function is automatically an algebraic function. Here are two more examples:

15 Function as Algebra Expression y = 2x the function maps x to y Domain is all values taken by x Range is values of y produced by x. Must fulfill all the criterion to be a function.

16 Function vs Equation Equations Functions a) A function which is not an equation. A function that assign different coloured shapes to their colours. b) An equation which is not a function. y 2 + x 2 = 3 c) An example of both function and equation. y = x + 1

17 Example 1 x 2 + y = 1 y = 1 – x 2 Each value of x corresponds to exactly one value of y. So, y is a function of x.

18 Example 2

19

20

21

22 Introduction  Definition 34 Let f be a function from the set A to the set B and let S be a subset of A. The image of S is the subset of B that consists of the images of the elements of S. We denote the image of S by f(S), so that f(S) = {f(s) | s  S}

23 Example  Let A={a, b, c, d, e} and B = { 1, 2, 3, 4} with f(a)=2, f(b) =1, f(c)=4, f(d)=1, and f(e)=1.  The image of the subset S = {b, c, d} is the set f(S)= {1, 4}.

24 Property of a function One-to-one function – injection Many-to-one function – surjection

25 One-to-One functions  Definition 35 A function f is said to be one-to-one, or injective, if and only if f(a)=f(b) implies that a=b for all a and b in the domain of f. A function is said to be an injection if it is one-to-one. Note:  A function f is one-to-one if and only if f(a)  f(b) whenever a  b.

26 Example 1 a b c d A one-to-one function

27 Example 2 Determine whether the function f(x)= x 2 from the set of integers to the set of integers is one-to- one. Solution: The function f(x)=x 2 is not one-to-one because, for instance f(1)=f(-1)=1, but -1  1.

28 Proving a function is one-to-one Method 1: Direct method Suppose f(x)=f(y) …. therefore x = y. Therefore f is one-to-one.

29 Proving a function is one-to-one Method 2: Contrapositive If f(x) = f(y) then x = y. Its contrapositive is If x  y, then f(x)  f(y). Suppose x  y…Therefore f(x)  f(y). Therefore f is one-to-one.

30 Proving a function is one-to-one Method 3: Contradiction Suppose f(x) = f(y) but x  y, obtained the contradiction that f(x)  f(y), therefore x = y and f is one-to-one.

31 Example Let f: Z  by f(x) = 3x + 4. Prove that f is one-to- one. Solution: Direct proof. Suppose f(x)=f(y). Then 3x + 4 = 3y + 4. Solving it we get x = y. Therefore f is one-to-one.

32 Example Let f: Z  by f(x) = 3x + 4. Prove that f is one-to- one. Contrapositive method: Suppose x  y, then f(x) = 3x + 4, and f(y) = 3x + 4. Since x  y, f(x)  f(y). f is one-to-one.

33 Example Let f: Z  by f(x) = 3x + 4. Prove that f is one-to- one. Contradiction: Suppose f(x) = f(y) and x  y. Consequently 3x + 4 = 3y + 4. Solving it we get x = y which contradict to our assumption x  y. Therefore, x must be equal to y. f is one-to-one.

34 Onto functions Definition 36 A function f from A to B is called onto, or surjective, if and only if for every element b  B there is an element a  A with f(a)=b. A function f is called a surjection if it is onto.

35 Example a b c d An Onto function

36 Onto functions  Example: Is the function f(x) = x 2 from the set of integers to the set of integers onto? Solution: The function f is not onto since there is no integer x with x 2 =-1, for instance.

37 One-to-One and Onto functions  Example: Is the function f(x)=x + 1 from the set of integers to the set of integers onto? Solution: The function f(x) = x + 1 is a onto function because for arbitrary value of x, we can find a value y such that x = y – 1, such that x is an image of y under function f.

38 One-to-One correspondence functions Definition 37 The function f is a one-to-one correspondence, or a bijection, if it is both one-to-one and onto.

39 One-to-One correspondence functions  Example: Let f be the function from {a, b, c, d} to {1, 2, 3, 4} with f(a) =4, f(b)=2, f(c)=1, and f(d)=3. Is f a bijection? Solution: The function f is one-to-one and onto. It is one-to-one since the function takes on distinct values. It is onto since all four elements of the codomain are images of elements in the domain. Hence, f is a bijection.

40 Example Surjection but not an injection

41 Example  Injection but not a surjection

42 Compositions of functions  Definition 39 Let g be a function from the set A to the set B and let f be a function from the set B to the set C. The composition of the functions f and g, denoted by f  g, is defined by (f  g)(a) = f(g(a)). Note: Composition of f  g, cannot be defined unless the range of g is a subset of the domain of f.

43 Compositions of functions

44 Compositions of functions  Example: Let g be the function from the set {a, b, c} to itself such that g(a)=b, g(b)=c, and g(c) = a. Let f be the function from the set {a, b, c} to the set {1, 2, 3} such that f(a)=3, f(b)=2, and f(c)=1. Find f  g and g  f? Solution: (f  g)(a) = f(g(a)) = f(b) = 2 (f  g)(b) = f(g(b)) = f(c) = 1 (f  g)(c) = f(g(c)) = f(a) = 3 g  f is not defined, because the range of f is not a subset of the domain of g.

45 Compositions of functions  Let f(x)= 2x + 3 and g(x) = 3x +2 where both functions are defined from the set of integers to a set of integers.  f  g = (f  g)(x)= f(g(x)) = f(3x + 2) = 2(3x + 2) + 3 = 6x + 7.

46 Some important functions

47 Some important functions  Example: