You are on page 1of 21

ISTANBUL AYDIN UNIVERSITY

FACULTY OF ENGINEERING
ELECTRICAL & ELECTRONICS ENGINEERING DEPT.

EEE247: DISCRETE MATHEMATICS

Functions

Instructor:
Dr. Mohammed Alkrunz
Electrical & Electronics Engineering Dept.
Functions,,,
 From calculus, you are familiar with the concept of a real-valued function
“𝑓”, which assigns to each number 𝑥 ∈ ℝ a particular value 𝑦 = 𝑓(𝑥),
where 𝑦 ∈ ℝ.
 But, the notion of a function can also be naturally generalized to the
concept of assigning elements of any set to elements of any set.
Formal Definition:
 For any set, A, B, we say that a function 𝑓 from (or “mapping”) A to B
(𝑓. 𝐴 → 𝐵) is a particular assignment of exactly one element 𝑓(𝑥) ∈ 𝐵 to
each element 𝑥 ∈ 𝐴.
 Two inputs could give one output such as 𝑦 = 𝑥 2 , but it is not possible for
one input to give two outputs. (i.e., two locations at one time)
Dr. M. Alkrunz
02.11.2019 2
EEE247: Discrete Mathematics
Functions,,,
Graphical Representations:

 Functions can be represented graphically in several ways:

a 𝑓 𝑎 =𝑏

𝒇
A B

“Venn Diagram” “Bipartite Graph” “Plot”

Dr. M. Alkrunz
02.11.2019 3
EEE247: Discrete Mathematics
Functions,,,
Functions that we’ve seen so far:

 A proposition can be viewed as a function from “situation” to truth values.

 A logic system called “Situation Theory”.

 𝑝 ≡ "𝑖𝑡 𝑖𝑠 𝑟𝑎𝑖𝑛𝑖𝑛𝑔“, s ≡ "𝑜𝑢𝑟 𝑠𝑖𝑡𝑢𝑎𝑡𝑖𝑜𝑛 𝑕𝑒𝑟𝑒, 𝑛𝑜𝑤“

 𝑝 𝑠 ∈ 𝑇, 𝐹

 A propositional operator can be viewed as a function from ordered pairs of


truth values to truth values:
𝒙 𝒚
 ∨ 𝐹, 𝑇 =𝑇 𝑓(𝑥)

 → 𝑇, 𝐹 =𝐹 𝑻 𝑻
𝑭 ∨

Dr. M. Alkrunz
02.11.2019 4
EEE247: Discrete Mathematics
Functions,,,
Functions that we’ve seen so far:

 A predicate can be viewed as a function from objects to propositions (or


truth values):

 𝑝 ≡ "𝑖𝑠 7 𝑓𝑒𝑒𝑡 𝑡𝑎𝑙𝑙“,

 𝑝 𝑀𝑖𝑘𝑒 ≡ "𝑀𝑖𝑘𝑒 𝑖𝑠 7 𝑓𝑒𝑒𝑡 𝑡𝑎𝑙𝑙“ ≡ 𝐹𝑎𝑙𝑠𝑒

 A bit string of length “n” can be viewed as a function from the numbers
1, 2, … , 𝑛 (bit positions) to the bits 0, 1

 𝐵 = 101, 𝑡𝑕𝑒𝑛 𝐵 3 = 1

 A set "𝑆“ over universe “𝑈” can be viewed as a function from the elements of
“𝑈” to 𝑇, 𝐹

 𝑆= 3, 𝑆 0 = 𝐹, 𝑆 3 =𝑇
Dr. M. Alkrunz
02.11.2019 5
EEE247: Discrete Mathematics
Functions,,,
Functions that we’ve seen so far:

 A set operator such as “⋃, ⋂, −” can be viewed as a function from pairs of


sets to sets.

⋂ 1, 3 , 3, 4 = 3

Some Functions Terminology:

 If 𝑓. 𝐴 → 𝐵 and 𝑓 𝑎 = 𝑏, where (𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵), then:


 “A” is the domain of 𝑓.
 “B” is the codomain of 𝑓.
 “b” is the image of “a” under 𝑓. In general, “b” may have
 “a” is a pre-image of “b” under 𝑓. more than 1 pre-image

Dr. M. Alkrunz
02.11.2019 6
EEE247: Discrete Mathematics
Functions,,,
Range V.S. Codomain:

 Suppose I declare to you that: “𝑓 is a function mapping students in this class


to the set of grades 𝐴, 𝐵, 𝐶, 𝐷, 𝐹 ”

 At this point (without exam), the codomain of 𝑓 is: 𝑨, 𝑩, 𝑪, 𝑫, 𝑭 , and


its range is: unknown.

 Suppose that grades turns out all A’s and B’s, then the range of 𝑓 will be
𝐴, 𝐵 , but its codomain is: 𝐴, 𝐵, 𝐶, 𝐷, 𝐹 .

 On other hand, the range is the actual output.

 The range: 𝑅 ⊆ 𝐵 of 𝑓 is 𝑏 ∃𝑎 𝑓 𝑎 = 𝑏

Dr. M. Alkrunz
02.11.2019 7
EEE247: Discrete Mathematics
Functions,,,
Constructing Function Operators

 If • (“dot”) is any operator over B, then we extend • to also denote an


operator over functions 𝑓. 𝐴 → 𝐵.

 E.g., Given any binary operator •: 𝐵 × 𝐵 → 𝐵, and functions 𝑓, 𝑔. 𝐴 → 𝐵, we


define 𝑓•𝑔 : 𝐴 → 𝐵 to be the function defined by ∀𝑎 ∈ 𝐴, 𝑓•𝑔 𝑎 =
𝑓 𝑎 •𝑔 𝑎 .

 +, × (“plus”, “times”) are binary operators over R. (Normal addition and


multiplication).

 Therefore, we can also add and multiply functions 𝑓, 𝑔. 𝑅 → 𝑅


 𝑓 + 𝑔 : 𝑅 → 𝑅, where 𝑓 + 𝑔 𝑥 = 𝑓 𝑥 + 𝑔 𝑥
 𝑓 × 𝑔 : 𝑅 → 𝑅, where 𝑓 × 𝑔 𝑥 = 𝑓 𝑥 × 𝑔 𝑥

Dr. M. Alkrunz
02.11.2019 8
EEE247: Discrete Mathematics
Functions,,,
Constructing Function Operators

 For functions 𝑔: 𝐴 → 𝐵 and 𝑓: 𝐵 → 𝐶, there is a special operator called


“Compose, ∘ ”. [Composition Function]

 It composes (creates) a new function out of 𝑓, 𝑔 by applying 𝑓 to the results


of 𝑔.

 𝑓 ∘ 𝑔 : 𝐴 → 𝐶, where 𝑓 ∘ 𝑔 𝑎 = 𝑓(𝑔 𝑎 ).

 Note 𝑔(𝑎) ∈ 𝐵, So 𝑓(𝑔 𝑎 ) is defined and ∈ 𝐶.

 Note that “∘” (like Cartesian ×, but unlike +, ∧, ∪) is non-commuting.


(Generally, 𝑓 ∘ 𝑔 ≠ 𝑔 ∘ 𝑓

Dr. M. Alkrunz
02.11.2019 9
EEE247: Discrete Mathematics
Functions,,,
Example:

Let 𝑓 𝑥 = 2𝑥 + 3 and 𝑔 𝑥 = 3𝑥 + 2, then:

 𝑓∘𝑔 𝑥 =𝑓 𝑔 𝑥 = 2 3𝑥 + 2 + 3 = 6𝑥 + 4 + 3 = 6𝑥 + 7

 𝑔∘𝑓 𝑥 =𝑔 𝑓 𝑥 = 3 2𝑥 + 3 + 2 = 6𝑥 + 9 + 2 = 6𝑥 + 11

One-to-One Functions:

 A function is one-to-one (1-1), or injective, or an injection iff every element of


its range has only one pre-image.

 Formally, given 𝑓: 𝐴 → 𝐵, “𝑥 is injective” ∶≡ ≦∃𝑥, 𝑦 𝑥 ≠ 𝑦 ∧ 𝑓(𝑥) = 𝑓(𝑦)

 I mean, there no exist two pre-image give one image.


Dr. M. Alkrunz
02.11.2019 10
EEE247: Discrete Mathematics
Functions,,,
 Only one element of the domain is mapped to any given one element of the
range.

 Domain and range have the same cardinality. What about the codomain?!! [it
could be greater or equal)

 Each element of the domain is injected into a different element of the range.

Dr. M. Alkrunz
02.11.2019 11
EEE247: Discrete Mathematics
Functions,,,
Example:

“one – to – one ” Not “one – to – one ” Not “one – to – one ”

Two pre-image give One input gives two


one image output (not a function)

Dr. M. Alkrunz
02.11.2019 12
EEE247: Discrete Mathematics
Functions,,,
Sufficient Condition for (1-1) Functions:

 For functions 𝑓 over numbers,

 𝑓 is strictly (or monotonically) increasing iff 𝑥 > 𝑦 → 𝑓 𝑥 > 𝑓(𝑦) for all 𝑥, 𝑦
in the domain.

 𝑓 is strictly (or monotonically) decreasing iff 𝑥 > 𝑦 → 𝑓 𝑥 < 𝑓(𝑦) for all 𝑥, 𝑦
in the domain.

Strictly 𝒇(𝒙) Strictly


Increasing 𝒇(𝒚) Decreasing
𝒇(𝒚)
Function 𝒇(𝒙) Function
𝒚 𝒙 𝒚 𝒙

Dr. M. Alkrunz
02.11.2019 13
EEE247: Discrete Mathematics
Functions,,,
 If 𝑓 is either strictly increasing or strictly decreasing, then 𝑓 is one to one.

 Example: 𝑥 3

 Converse is not necessarily true. Example: 1 𝑥 [at zero we have 2 values]

Dr. M. Alkrunz
02.11.2019 14
EEE247: Discrete Mathematics
Functions,,,
Onto Functions:

 A function 𝑓. 𝐴 → 𝐵 is onto or surjective or surjection iff its range is equal to


its codomain.

 ∀ 𝑏 ∈ 𝐵, ∃ 𝑎 ∈ 𝐴: 𝑓 𝑎 = 𝑏 [I mean there exist a value in the domain


produce the range, or all elements in the codomain could be produced from
domain].

 An Onto function maps the set A onto (over, covering) the entirely of the set
B, not just over a piece of it.

 E.g., for domain and codomain “R”, 𝑥 3 is Onto, whereas 𝑥 2 is not [WHY?!!]
 In 𝑥 3 , the domain and codomain is R.
 In 𝑥 2 , the domain and codomain is not R.

Dr. M. Alkrunz
02.11.2019 15
EEE247: Discrete Mathematics
Functions,,,
Example:

Dr. M. Alkrunz
02.11.2019 16
EEE247: Discrete Mathematics
Functions,,,
Bijections:

 A function 𝑓 is one-to-one correspondence, or a bijection, or reversible, or


invertible, iff it is both One-to-one and Onto.

 For bijections 𝑓: 𝐴 → 𝐵, there exists an inverse of 𝑓, written 𝑓 −1 : 𝐴 → 𝐵


which is the unique function such that 𝑓 −1 ∘ 𝑓 = 𝐼 (identity Function)

Identity Function:

 For any domain “A”, the identity function 𝐼: 𝐴 → 𝐴 (written as, 𝐼𝐴 ) is the
unique function such that (∀ 𝑎 ∈ 𝐴: 𝐼 𝑎 = 𝑎)

 Examples: adding to zero, multiplying by one, and with true, or with


false, union with null, intersection with domain.
Dr. M. Alkrunz
02.11.2019 17
EEE247: Discrete Mathematics
Functions,,,
A couple of Key Functions:

 In discrete math, we will frequently use the following functions over real
numbers:

 𝑥 (“floor of x”) is the largest (greatest integer function) integer ≤ 𝑥.

 𝑥 (“ceiling of x”) is the smallest integer ≥ 𝑥.

Visualizing Floor and Ceiling Functions:

 Real numbers “fall to their floor” or “rise to their ceiling”.

 Note that if 𝑥 ∉ 𝑍, then −𝑥 ≠ − 𝑥 and −𝑥 ≠ − 𝑥

 Note that if 𝑥 ∈ 𝑍, then 𝑥 = 𝑥 = 𝑥.

 Example: 1.6 = 2, 1.6 = 1, −1.4 = −1, −1.4 = −2, −3 = −3 = −3


Dr. M. Alkrunz
02.11.2019 18
EEE247: Discrete Mathematics
Functions,,,
Plots with Floor/Ceiling:

 Sets that do not include all of their limit points are called “Open Sets”.

 In a plot, we draw a limit point of a curve using an open dot (circle) if the limit
point is not on the curve, and with a closed dot (solid) if it is on the curve.

𝒙 𝒙
Dr. M. Alkrunz
02.11.2019 19
EEE247: Discrete Mathematics
*Questions

Dr. M. Alkrunz
02.11.2019 20
EEE247: Discrete Mathematics
*Thanks
Dr. M. Alkrunz
02.11.2019 21
EEE247: Discrete Mathematics

You might also like