<<

Page 1 of 9

Discrete Functions

Definition: A 푓 from a 퐴 to a set 퐵, denoted 푓: 퐴 → 퐵 is a well-defined rule that assigns each of 퐴 to exactly one element of 퐵. We write 푓(푎) = 푏 if 푏 is the unique element of 퐵 assigned by the function f to the element 푎 of 퐴.

Example:

Recall: Let 퐴 and 퐵 be sets. The of 퐴 and 퐵, denoted by 퐴 × 퐵, is the set of all ordered pairs (푎, 푏), where 푎 ∈ 퐴 and 푏 ∈ 퐵.

We can define a function 푓: 퐴 → 퐵 as a of the Cartesian product 퐴 × 퐵.

© 2020, I. Perepelitsa

Page 2 of 9

Given a function f : A → B:

 We say f maps A to B or f is a mapping from A to B.  A is called the domain of f.  B is called the codomain of f.  If f(a) = b,  then b is called the of a under f.  a is called the preimage of b.  The range of f is the set of all images of points in A under f. We denote it by f(A).  Two functions are equal when they have the same domain, the same codomain and each element of the domain to the same element of the codomain.

Example: Let 푓: 퐴 → 퐵, where 퐴 = {푎, 푏, 푐, 푑}, 퐵 = {푥, 푦, 푧}, and 푓(푎) = 푧, 푓(푏) = 푦, 푓(푐) = 푧, 푓(푑) = 푧.

a. 푓(푎) =?

b. The image of 푑 is?

c. The domain of 푓 is?

d. The codomain of 푓 is?

e. The preimage of 푦 is?

f. 푓(퐴) = ?

g. The preimage(s) of 푧 is (are)?

h. The range of 푓 is?

© 2020, I. Perepelitsa

Page 3 of 9

Definition: A function f is said to be one-to-one, or injective, if and only if 푓(푎) = 푓(푏) implies that 푎 = 푏 for all 푎 and 푏 in the domain of 푓. A function is said to be an injection if it is one-to-one.

Example:

Definition: A function 푓 from 퐴 to 퐵 is called onto or surjective, if and only if for every element 푏 ∈ 퐵 there is an element 푎 ∈ 퐴 with 푓(푎) = 푏. A function f is called a surjection if it is onto.

Example:

Definition: A function f is a one-to-one correspondence, or a , if it is both one-to-one and onto (surjective and injective).

Example:

© 2020, I. Perepelitsa

Page 4 of 9

Suppose that 푓: 퐴 → 퐵.

To show that 풇 is injective: Show that if 푓(푥) = 푓(푦) for arbitrary 푥, 푦 ∈ 퐴, then 푥 = 푦.

To show that 풇 is not injective: Find particular elements 푥, 푦 ∈ 퐴 such that 푥 ≠ 푦 and

푓(푥) = 푓(푦).

To show that 풇 is surjective: Consider an arbitrary element 푦 ∈ 퐵 and find an element 푥 ∈

퐴 such that 푓(푥) = 푦.

To show that 풇 is not surjective: Find a particular 푦 ∈ 퐵 such that 푓(푥) ≠ 푦 for all 푥 ∈ 퐴.

Example: Let 푓 be the function from {푎, 푏, 푐, 푑} to {1,2,3} defined by 푓(푎) = 3, 푓(푏) = 2, 푓(푐) = 1, and 푓(푑) = 3. Is f an onto function?

Example: Is the function 푓(푥) = 푥2 from the set of integers to the set of integers onto?

Example: Determine if each function is a bijection. a. 푓(푥) = 2푥 + 1

© 2020, I. Perepelitsa

Page 5 of 9

b. 푓(푥) = 푥2 + 1

Definition: Let 푓 be a bijection from 퐴 to 퐵. Then the inverse of 푓, denoted 푓−1, is the function from 퐵 to 퐴 defined as 푓−1(푦) = 푥 iff 푓(푥) = 푦.

No inverse exists unless f is a bijection. Why?

© 2020, I. Perepelitsa

Page 6 of 9

Example: Let f be the function from {a, b, c} to {1,2,3} such that f(a) = 2, f(b) = 3, and f(c) = 1. Is f invertible and if so what is its inverse?

Example: Let 푓: ℤ → ℤ be such that 푓(푥) = 2푥 + 1. Is 푓 invertible, and if so, what is its inverse?

Example: Let 푓: ℝ → ℝ be such that 푓(푥) = |푥|. Is 푓 invertible, and if so, what is its inverse?

© 2020, I. Perepelitsa

Page 7 of 9

Definition: Let 푓: 퐵 → 퐶, 푔: 퐴 → 퐵. The composition of 푓 with 푔, denoted 푓 ∘ 푔 is the function from 퐴 to 퐶 defined by (푓 ∘ 푔)(푥) = 푓(푔(푥)).

Example: 푓(푥) = 푥2 and 푔(푥) = 2푥 + 1. Find (푓 ∘ 푔)(푥) and 푔 ∘ 푓(푥).

Example: Let g be the function from the set {a, b, c} to itself such that g(a) = b, g(b) = c, and g(c) = a. Let f be the function from the set {a, b, c} to the set {1,2,3} such that f(a) = 3, f(b) = 2, and f(c) = 1. What is the composition of f and g, and what is the composition of g and f.

© 2020, I. Perepelitsa

Page 8 of 9

Some important functions

 The floor function, denoted ⌊푥⌋ is the largest integer less than or equal to 푥.  The ceiling function, denoted ⌈푥⌉is the smallest integer greater than or equal to 푥.

Example:

© 2020, I. Perepelitsa

Page 9 of 9

 Factorial function Definition: 푓: ℕ → ℤ+, denoted by 푓(푛) = 푛! is the product of the first 푛 positive integers. 푓(푛) = 1 ∙ 2 ∙ 3 ⋯ (푛 − 1) ∙ 푛 . 푓(0) = 0! = 1

Example: Find f(2), f(3), f(4).

© 2020, I. Perepelitsa