Lecture 15 Functions CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.

Slides:



Advertisements
Similar presentations
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Advertisements

Factors, Primes & Composite Numbers
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
0 - 0.
ALGEBRAIC EXPRESSIONS
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
© S Haughton more than 3?
Digital Lesson An Introduction to Functions. Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 A relation is a rule of correspondence.
Functions Rosen 1.8.
Duplex Fractions, f(x), and composite functions. [f(x) = Find f -1 (x)] A.[3x – 5 ] B.[3x – 15 ] C.[1.5x – 7.5 ] D.[Option 4]
Energy & Green Urbanism Markku Lappalainen Aalto University.
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
Basic Structures: Functions and Sequences
Discrete Mathematics Math 6A
Addition 1’s to 20.
25 seconds left…...
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Test B, 100 Subtraction Facts
U2 L5 Quotient Rule QUOTIENT RULE
Fall 2014 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
11 = This is the fact family. You say: 8+3=11 and 3+8=11
Week 1.
Lecture 12 Permutations and Combinations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Mathematics1 Mathematics 1 Applied Informatics Štefan BEREŽNÝ.
Lecture 11 Mathematical Induction CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Lecture 20 Finite State Machines CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Lecture 13 Elements of Probability CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Lecture 16 Complexity of Functions CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
8.3 Inverse Linear Transformations
Equivalence Relations
Copyright © Cengage Learning. All rights reserved.
Lecture 2 Introduction To Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Permutations and Inverses. Definition Let A be a set. If f : A  A is a 1-1 correspondence then f is called a permutation of A. Notation: S(A): the set.
Functions Goals Introduce the concept of function Introduce injective, surjective, & bijective functions.
Lecture 3 Operations on Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Functions.
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. 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.
Lecture 14 Relations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Lecture 4 Sequences CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Lecture 17 Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Mathematics for Computing Lecture 8: Functions Dr Andrew Purkiss-Trew Cancer Research UK
FUNCTIONS.
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.
Functions Reading: Chapter 6 (94 – 107) from the text book 1.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
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.
Lecture 5 Regular Expressions CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Discrete Mathematics Relation.
CSNB 143 Discrete Mathematical Structures
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.
Lecture 19 Minimal Spanning Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Functions – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Functions Reading: Kolman, Section 5.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.
FUNCTIONS.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
Functions Goals Introduce the concept of function
Functions Section 2.3.
Presentation transcript:

Lecture 15 Functions CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine

CSCI 1900 Lecture Lecture Introduction Reading –Rosen - Section 2.3 Definition of a function Representation of a function Composition Special types of functions Theorems on functions

CSCI 1900 Lecture Review: Dom and Ran of a Relation Given R - a relation from the set A to the set B, then –Domain of R - Dom(R) Subset of A containing elements that are related to some element in B –Range of R - Ran(R) Subset of B containing all second elements of the pairs defining R The same definitions apply to functions

CSCI 1900 Lecture Functions A function f is a relation from A to B –f : A → B –Each element of A in the domain of f maps to at most one element in B –Alternatively f (a) = b If an element a is not in the domain of f, – f (a) is undefined –Written as f (a) = 

CSCI 1900 Lecture Functions (cont) Functions are also called mappings or transformations –View as rules that assign an element of A to one element of B Elements of A Elements of B

CSCI 1900 Lecture Functions (cont) Because f is a relation, it too is a subset of the Cartesian Product A  B Even though there might be multiple sequence pairs that have the same element b, no two sequence pairs may have the same first element a

CSCI 1900 Lecture Functions Represented by Formulae It may be possible to represent a function with a formula –Example: f (x) = x 2 (mapping from Z to N) A function is not necessarily represented with a formula –Because a function is a relation It is therefore just a subset of the Cartesian product It may be that a function is represented only as a set of ordered pairs

CSCI 1900 Lecture Functions Without Formulae Example: A mapping from one finite set to another –A = { b, c, d, e} and B = {4, 6} –f (a) = {(b, 4), (c, 6), (d, 6), (e, 4)} Example: Membership function –f (a) return 0 if a is even, 1 otherwise –A = Z B = {0,1}

CSCI 1900 Lecture Identity Function The identity function is a function on A –Denoted 1 A –Defined by 1 A (a) = a

CSCI 1900 Lecture Composition If f : A → B and g : B → C, then the composition of f and g, (written as g  f ), is a function Let a  Dom(g  f). –(g  f )( a ) = g( f ( a ) ) –Because f( a ) maps to exactly one element, say b  B g( f (a ) ) = g( b ) –Because g( b ) maps to exactly one element, say c  C g( f (a) ) = c –Thus for each a  A, (g  f )(a) maps to exactly one element of C –Therefore: g  f is a function

CSCI 1900 Lecture Composition A=B=C=Z, f : A → B, and g : B → C f (a) = a+1, g(b)=2b Ex: g  f (3)= g( f(3) ) = g( 4)= 8 g  f(a)= g( f(a) ) = g( a+1) = 2(a+1) =2a +2 A B C f g g  f

CSCI 1900 Lecture Special Types of Functions f : A → B is “everywhere defined ” if –Dom(f ) = A f : A → B is “onto” if –Ran(f ) = B f : A → B is “one-to-one” if –It is impossible to have f (a) = f (a') if a  a ' i.e., if f (a) = f (a'), then a = a' f : A → B is “invertible” if –Its inverse, f -1, is also a function (Note, f -1 is simply the reversing of the ordered pairs)

CSCI 1900 Lecture Onto Functions If Ran(f)=B, then f is onto a b c d a b c d 5 OntoNOT Onto

CSCI 1900 Lecture One-to-One Functions f : A → B is one to one if no two elements of A map to the same element in B –If f(a)=f(b) implies a=b, then f is one to one –If f(a)=f(b) and a  b, then f is not one to one One to One NOT One to One a b c d e a b c d e

CSCI 1900 Lecture Bijection If f : A → B is one to one and onto, then f has one to one correspondence between the domain and the range or is bijective a b c d

CSCI 1900 Lecture Theorem of Functions If f is –Everywhere defined –One-to-one, –Onto then f is a one-to-one correspondence between A & B Thus f is invertible and f -1 is a one-to-one correspondence between B & A

CSCI 1900 Lecture More Theorems of Functions Let f be any function: 1 B  f = f f  1 A = f If f is a one-to-one correspondence between A and B, then f -1  f = 1 A f  f -1 = 1 B

CSCI 1900 Lecture More Theorems of Functions (cont) Let f : A → B and g : B → C Further let f and g be invertible (g  f) is invertible (g  f) -1 = (f -1  g -1 )

CSCI 1900 Lecture Key Concepts Summary Definition of a function Representation of a function Composition Special types of functions Theorems on functions Reading for next lecture –Kolman - Section 5.2, 5.3