CS 250, Discrete Structures, Fall 2014

Slides:



Advertisements
Similar presentations
Lecture 2.3: Set Theory, and Functions* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Advertisements

Lecture 4.5: POSets and Hasse Diagrams CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
9/8/2011Lecture Functions1 Lecture 2.4: Functions CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Lecture 3.1: Mathematical Induction CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Composition of Functions. Definition of Composition of Functions The composition of the functions f and g are given by (f o g)(x) = f(g(x))
Lecture 3.4: Recursive Algorithms CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
FUNCTIONS.
Chapter 7 7.6: Function Operations. Function Operations.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and.
1 Lecture 3.3: Recursion CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 4.3: Closures and Equivalence Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
2.4 Continuity and its Consequences and 2.8 IVT Tues Sept 15 Do Now Find the errors in the following and explain why it’s wrong:
Lecture 2.1: Sets and Set Operations CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 4.1: Relations Basics CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 4.2: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 2.3: Set Theory, and Functions*
Lecture 2.2: Set Theory CS 250, Discrete Structures, Fall 2015 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 4.2: Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 2.5: Sequences CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
CSC102 - Discrete Structures Functions
1 Discrete Mathematical Functions Examples.
Lecture 1.5: Proof Techniques CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren 1.
Lecture 4.1: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
9/29/2011Lecture Strong Induction1 Lecture 3.2: Strong Induction CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures.
9/27/2011 Lecture Mathematical Induction1 Lecture 3.1: Mathematical Induction* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from.
Lecture 3.4: Recursive Algorithms CS 250, Discrete Structures, Fall 2015 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
Lecture 1.5: Proof Techniques
Lecture 5.4: Paths and Connectivity
Lecture 4.1: Relations Basics
Lecture 1.5: Proof Techniques
Lecture 4.3: Closures and Equivalence Relations
Lecture 3.2: Induction and Strong Induction (contd.)
Functions Section 2.3.
Lecture 4.1: Relations Basics
Lecture 3.2: Induction, and Strong Induction
CS 250, Discrete Structures, Fall 2015
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
Lecture 3.2: Induction and Strong Induction (contd.)
Lecture 3.2: Induction, and Strong Induction
CS 250, Discrete Structures, Fall 2014
CS 250, Discrete Structures, Fall 2013
CS 250, Discrete Structures, Fall 2015
CS 250, Discrete Structures, Fall 2015
Activity 2.8 Study Time.
Lecture 4.3: Closures and Equivalence Relations
Lecture 3.2: Induction, and Strong Induction
Lecture 1.6: Proof Techniques (contd)
Lecture 1.3: Predicate Logic
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Lecture 2.1: Sets and Set Operations*
CS 250, Discrete Structures, Fall 2013
Lecture 2.3: Set Theory, and Functions
CS 250, Discrete Structures, Fall 2013
SE-561 Math Foundations of Software Engineering VIII. Functions
Lecture 3.1: Mathematical Induction
Lecture 4.1: Relations Basics
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Lecture 1.6: Proof Techniques (contd)
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Lecture 2.3: Set Theory, and Functions
Functions Section 2.3.
Copyright © Zeph Grunschlag,
Lecture 3.1: Mathematical Induction
CS 336/536: Computer Network Security Fall 2015 Nitesh Saxena
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Lecture 1.3: Predicate Logic
CS 250, Discrete Structures, Fall 2012
Presentation transcript:

CS 250, Discrete Structures, Fall 2014 Lecture 2.4: Functions CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag

Course Admin HW1 Mid Term 1: Oct 7 (Tues) Provided the solution Working on grading Mid Term 1: Oct 7 (Tues) Review Oct 2 (Thu) Covers Chapter 1 and Chapter 2 HW2 coming out: early next week Due Oct 14 (Tues) 1/14/2019 Lecture 2.4 -- Functions

Outline Functions compositions common examples 1/14/2019 Lecture 2.4 -- Functions

Function Composition When a function f outputs elements of the same kind that another function g takes as input, f and g may be composed by letting g immediately take as an input each output of f Definition: 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)) f g is also called fog 1/14/2019 Lecture 2.4 -- Functions

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 1/14/2019 Lecture 2.4 -- Functions

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

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 1/14/2019 Lecture 2.4 -- Functions

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 1/14/2019 Lecture 2.4 -- Functions

Composition - a little theorem Let f:AB, and g:BC be functions. Prove that if f and g are one to one, then g o f :AC is one to one. Recall defn of one to one: f:A->B is 1to1 if f(a)=b and f(c)=b  a=c. Suppose g(f(x)) = y and g(f(w)) = y. Show that x=w. f(x) = f(w) since g is 1 to 1. Then x = w since f is 1 to 1. 1/14/2019 Lecture 2.4 -- Functions

Commonly Encountered Functions Polynomials: f(x) = a0xn + a1xn-1 + … + an-1x1 + anx0 Ex: f(x) = x3 - 2x2 + 15; f(x) = 2x + 3 Exponentials: f(x) = cdx Ex: f(x) = 310x, f(x) = ex Logarithms: log2 x = y, where 2y = x. 1/14/2019 Lecture 2.4 -- Functions

Some New functions Ceiling: f(x) = x the least integer y so that x  y. Ex: 1.2 = 2; -1.2 = -1; 1 = 1 Floor: f(x) = x the greatest integer y so that x  y. Ex: 1.8 = 1; -1.8 = -2; -5 = -5 Quiz: what is -1.2 + 1.1 ? 1/14/2019 Lecture 2.4 -- Functions

Today’s Reading Rosen 2.3 1/14/2019 Lecture 2.4 -- Functions