Copyright © Zeph Grunschlag,

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

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.
Functions.
Copyright © Cengage Learning. All rights reserved.
Functions; Sequences, Sums, Countability
Functions Section 2.3 of Rosen Fall 2008
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
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.
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.
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!
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.
Relations and Functions Another Foundational Concept Copyright © 2014 – Curt Hill.
9/8/2011Lecture Functions1 Lecture 2.4: Functions CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.
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.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
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,
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 
Functions Reading: Chapter 6 (94 – 107) from the text book 1.
Basic Structures: Functions Muhammad Arief download dari
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. 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.
MATH 224 – Discrete Mathematics
MAT 2720 Discrete Mathematics Section 3.1 Functions
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.
CSC102 - Discrete Structures Functions
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
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.
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 Goals Introduce the concept of function
Functions Section 2.3.
Relations, Functions, and Matrices
MATH 224 – Discrete Mathematics
Functions.
Chapter 2 Sets and Functions.
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,
… and the following mathematical appetizer is about…
Functions Section 2.3.
Discrete Math (2) Haiming Chen Associate Professor, PhD
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.
CS 250, Discrete Structures, Fall 2014
CS 250, Discrete Structures, Fall 2015
CS 250, Discrete Structures, Fall 2013
Functions Rosen 6th ed., §2.3.
SE-561 Math Foundations of Software Engineering VIII. Functions
Lecture # 18 Types of Functions
Functions Section 2.3.
CS 250, Discrete Structures, Fall 2012
Presentation transcript:

Copyright © Zeph Grunschlag, 2001-2002. Functions Zeph Grunschlag Copyright © Zeph Grunschlag, 2001-2002.

Agenda Section 1.6: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and exponentiation Ceiling “ ” and floor “ ” L6

Functions In high-school, functions are often identified with the formulas that define them. EG: f (x ) = x 2 This point of view does not suffice in Discrete Math. In discrete math, functions are not necessarily defined over the real numbers. EG: f (x ) = 1 if x is odd, and 0 if x is even. So in addition to specifying the formula one needs to define the set of elements which are acceptable as inputs, and the set of elements into which the function outputs. L6

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 every element a of A, specifies a unique element f (a) in B. f (a) is called the image of a, while a is called the pre-image of f (a). The range (or image) of f is defined by f (A) = {f (a) | a  A }. L6

Functions. Basic-Terms. EG: Let f : Z  R be given by f (x ) = x 2 Q1: What are the domain and co-domain? Q2: What’s the image of -3 ? Q3: What are the pre-images of 3, 4? Q4: What is the range f (Z) ? L6

Functions. Basic-Terms. f : Z  R is given by f (x ) = x 2 A1: domain is Z, co-domain is R A2: image of -3 = f (-3) = 9 A3: pre-images of 3: none as 3 isn’t an integer! pre-images of 4: -2 and 2 A4: range is the set of perfect squares f (Z) = {0,1,4,9,16,25,…} L6

One-to-One, Onto, Bijection. Intuitively. Represent functions using “node and arrow” notation: One-to-One means that no clashes occur. BAD: a clash occurred, not 1-to-1 GOOD: no clashes, is 1-to-1 Onto means that every possible output is hit BAD: 3rd output missed, not onto GOOD: everything hit, onto L6

One-to-One, Onto, Bijection. Intuitively. Bijection means that when arrows reversed, a function results. Equivalently, that both one-to-one’ness and onto’ness occur. BAD: not 1-to-1. Reverse over-determined: BAD: not onto. Reverse under-determined: GOOD: Bijection. Reverse is a function: L6

One-to-One, Onto, Bijection. Formal Definition. DEF: A function f : A B is: one-to-one (or injective) if different elements of A always result in different images in B. onto (or surjective) if every element in B is hit by f. I.e., f (A ) = B. a one-to-one correspondence (or a bijection, or invertible) if f is both one-to-one as well as onto. If f is invertible, its inverse f -1 : B A is well defined by taking the unique element in the pre-image of b, for each b  B. Alternate definitions using cardinality of pre-image: Injective: |f -1(b)| ≤ 1 for all b  B. Surjective: |f -1(b)|≥ 1 for all b  B. Bijective: |f -1(b)| = 1 for all b  B. L6

One-to-One, Onto, Bijection. Examples. Q: Which of the following are 1-to-1, onto, a bijection? If f is invertible, what is its inverse? f : Z  R is given by f (x ) = x 2 f : Z  R is given by f (x ) = 2x f : R  R is given by f (x ) = x 3 f : Z  N is given by f (x ) = |x | L6

One-to-One, Onto, Bijection. Examples. f : Z  R, f (x ) = x 2: none not 1-1 clashes for -1,1 in Z not onto -1,-2 missed from R f : Z  R, f (x ) = 2x : 1-1 f : R  R, f (x ) = x 3: 1-1, onto, bijection, inverse is f (x ) = x (1/3) f : Z  N, f (x ) = |x |: onto L6

Composition stop here http://info.psu.edu.sa/psu/cis/kalmustafa/ When a function f spits out elements of the same kind that another function g eats, f and g may be composed by letting g immediately eat each output of f. DEF: Suppose that g : A  B and f : B  C are functions. Then the composite f g : A  C is defined by setting f g (a) = f ( g (a) ) L6

Composition. Examples. Q: Compute g f where 1. f : Z  R, f (x ) = x 2 and g : R  R, g (x ) = x 3 2. f : Z  Z, f (x ) = x + 1 and g = f -1 so g (x ) = x – 1 3. f : {people}  {people}, f (x ) = the father of x, and g = f L6

Composition. Examples. 1. f : Z  R, f (x ) = x 2 and g : R  R, g (x ) = x 3 f g : Z  R , f g (x ) = x 6 2. f : Z  Z, f (x ) = x + 1 and g = f -1 f g (x ) = x (true for any function composed with its inverse) 3. f : {people}  {people}, f (x ) = g(x ) = the father of x f g (x ) = grandfather of x from father’s side L6

f n (x ) = f f f f  … f (x ) Repeated Composition When the domain and codomain are equal, a function may be self composed. The composition may be repeated as much as desired resulting in functional exponentiation. The whole process is denoted by f n (x ) = f f f f  … f (x ) where f appears n –times on the right side. Q1: Given f : Z  Z, f (x ) = x 2 find f 4 Q2: Given g : Z  Z, g (x ) = x + 1 find g n Q3: Given h(x ) = the father of x, find hn L6

Repeated Composition A1: f : Z  Z, f (x ) = x 2. f 4(x ) = x (2*2*2*2) = x 16 A2: g : Z  Z, g (x ) = x + 1 gn (x ) = x + n A3: h (x ) = the father of x, hn (x ) = x ’s n’th patrilineal ancestor L6

Ceiling and Floor This being a course on discrete math, it is often useful to discretize numbers, sets and functions. For this purpose the ceiling and floor functions come in handy. DEF: Given a real number x : The floor of x is the biggest integer which is smaller or equal to x The ceiling of x is the smallest integer greater or equal to x. NOTATION: floor(x) = x , ceiling(x) = x  Q: Compute 1.7, -1.7, 1.7, -1.7. L6

Ceiling and Floor A: 1.7 = 1, -1.7 = -2, 1.7 = 2, -1.7 = -1 Prove : show that for all positive real numbers x, y:  x.y  <=  x .  y  L6