Professional Documents
Culture Documents
2
Function: Formal Definition
• For any sets and , we say that a function (or “mapping”) from
to ( ∶ → ) is a particular assignment of exactly one element
( ) ∈ to each element ∈ .
• Functions can be represented graphically in several ways:
3
Terminology
4
Range vs Codomain
5
Example
6
Function and Non-Function
a 1 a 1
Valid Valid
b 2 Function b 2
Function
c 3 c 3
d 4 d 4
a 1 1
8
Function Composition Operator
9
Function Composition
• : → , ∶ →
10
Function Composition
• : → , ∶ →
11
Function Composition Example
12
Function Composition Example
( ◦ )( ) = ( ( ))
= ( )
= 2 + 1
• Note that ◦ ≠ ◦ . (4 +4 +1 ≠ 2 + 1)
13
Images of Sets Under Functions
• Given ∶ → , and ⊆ ,
• The image of under f is simply the set of all images (under ) of the
elements of
( ) = { ( )| ∈ }
= { |∃ ∈ : ( ) = }
14
One-to-One Function
15
One-to-One Illustration
16
One-to-one Functions
• Example:
• Is the function ∶ { , , , } → {1, 2, 3, 4, 5} with
• ( ) = 4, ( ) = 5, ( ) = 1, and ( ) = 3 one-to-one?
• Yes, it is one-to-one
• No element of the range is assigned more than once to any element of the
domain
• Example:
• Let ∶ → such that ( ) = . Is one-to-one?
• No, it is not because (−2) = (2) = 4 even though 2 ≠ −2
• Generally for this function = (− ) even though ≠ −
17
Sufficient Conditions for one-to-oneness
18
Onto (Surjective) Functions
19
Illustration of Onto
20
Bijections and Inversible Functions
21
Inverse Function Illustration
• Let : → be a bijection
22
Inversible Function Examples
23
Mappings in Java
24
Images, Range, Bijection in Java
25