You are on page 1of 107

Discrete Mathematics

Lecture 3 - Functions

Askar Dzhumadil’daev

Kazakh-British Technical University

July 23, 2020

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 1 / 31
Function

Next in importance to the primitive notion of set is idea of function.

Definition(Function)
A function from a set A to a set B is a binary relation from A to B with the
property that, for every a 2 A, there is exactly one b 2 B such that
(a, b) 2 f .

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 2 / 31
Function

Next in importance to the primitive notion of set is idea of function.

Definition(Function)
A function from a set A to a set B is a binary relation from A to B with the
property that, for every a 2 A, there is exactly one b 2 B such that
(a, b) 2 f .

Examples
Let A = {1, 2, 3} and B = {x, y}.
If f = {(1, x), (2, y), (3, x)}, then

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 2 / 31
Function

Next in importance to the primitive notion of set is idea of function.

Definition(Function)
A function from a set A to a set B is a binary relation from A to B with the
property that, for every a 2 A, there is exactly one b 2 B such that
(a, b) 2 f .

Examples
Let A = {1, 2, 3} and B = {x, y}.
If f = {(1, x), (2, y), (3, x)}, then f is a function from A to B.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 2 / 31
Function

Next in importance to the primitive notion of set is idea of function.

Definition(Function)
A function from a set A to a set B is a binary relation from A to B with the
property that, for every a 2 A, there is exactly one b 2 B such that
(a, b) 2 f .

Examples
Let A = {1, 2, 3} and B = {x, y}.
If f = {(1, x), (2, y), (3, x)}, then f is a function from A to B.
If g = {(1, x), (3, y)}, then

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 2 / 31
Function

Next in importance to the primitive notion of set is idea of function.

Definition(Function)
A function from a set A to a set B is a binary relation from A to B with the
property that, for every a 2 A, there is exactly one b 2 B such that
(a, b) 2 f .

Examples
Let A = {1, 2, 3} and B = {x, y}.
If f = {(1, x), (2, y), (3, x)}, then f is a function from A to B.
If g = {(1, x), (3, y)}, then g is not a function from A to B, because g
contains no ordered pair with first coordinate 2.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 2 / 31
Function

Next in importance to the primitive notion of set is idea of function.

Definition(Function)
A function from a set A to a set B is a binary relation from A to B with the
property that, for every a 2 A, there is exactly one b 2 B such that
(a, b) 2 f .

Examples
Let A = {1, 2, 3} and B = {x, y}.
If f = {(1, x), (2, y), (3, x)}, then f is a function from A to B.
If g = {(1, x), (3, y)}, then g is not a function from A to B, because g
contains no ordered pair with first coordinate 2.
If h = {(1, x), (2, x), (3, y), (2, y)}, then

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 2 / 31
Function

Next in importance to the primitive notion of set is idea of function.

Definition(Function)
A function from a set A to a set B is a binary relation from A to B with the
property that, for every a 2 A, there is exactly one b 2 B such that
(a, b) 2 f .

Examples
Let A = {1, 2, 3} and B = {x, y}.
If f = {(1, x), (2, y), (3, x)}, then f is a function from A to B.
If g = {(1, x), (3, y)}, then g is not a function from A to B, because g
contains no ordered pair with first coordinate 2.
If h = {(1, x), (2, x), (3, y), (2, y)}, then h is not a function from A to B,
because 2 is the first coordinate of two ordered pairs.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 2 / 31
f : A ! B and f : a 7! b
Function notations
(a, b) 2 f if and only if b = f (a).
f is a function from A to B if and only if f : A ! B
f (a) = b if and only if f : a 7! b.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 3 / 31
f : A ! B and f : a 7! b
Function notations
(a, b) 2 f if and only if b = f (a).
f is a function from A to B if and only if f : A ! B
f (a) = b if and only if f : a 7! b.
Thus, the function f = {(1, x), (2, y), (3, x)} could be also described by
1 7! x
f: 2 7! y
3 7! x

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 3 / 31
f : A ! B and f : a 7! b
Function notations
(a, b) 2 f if and only if b = f (a).
f is a function from A to B if and only if f : A ! B
f (a) = b if and only if f : a 7! b.
Thus, the function f = {(1, x), (2, y), (3, x)} could be also described by
1 7! x
f: 2 7! y
3 7! x
Sometimes (often in calculus), a function is sufficiently nice that it is possible
to write down a precise formula showing how f (x) is determined by x;
for example f (x) = x3 , f (x) = 3x 7, f (x) = ln(x).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 3 / 31
f : A ! B and f : a 7! b
Function notations
(a, b) 2 f if and only if b = f (a).
f is a function from A to B if and only if f : A ! B
f (a) = b if and only if f : a 7! b.
Thus, the function f = {(1, x), (2, y), (3, x)} could be also described by
1 7! x
f: 2 7! y
3 7! x
Sometimes (often in calculus), a function is sufficiently nice that it is possible
to write down a precise formula showing how f (x) is determined by x;
for example f (x) = x3 , f (x) = 3x 7, f (x) = ln(x).

Definition
Let f : A ! B be a function from A to B.
The domain of f , written D(f ), is the set A and the target of f is B.
The image of f , written Im(f ), is
Im(f ) = {b 2 B | b = f (a) for some a 2 A}.
Askar Dzhumadil’daev (Kazakh-BritishDiscrete
Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 3 / 31
Im(f ) = B

Definition (Onto)
Let f : A ! B. The function f is said to be onto (surjective) if and only if for
any b 2 B, there exists a 2 A such that f (a) = b.
In other words,
f is onto if and only if Im(f ) = B.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 4 / 31
Im(f ) = B

Definition (Onto)
Let f : A ! B. The function f is said to be onto (surjective) if and only if for
any b 2 B, there exists a 2 A such that f (a) = b.
In other words,
f is onto if and only if Im(f ) = B.

Examples
Let A = {1, 2, 3, 4} and B = {x, y, z}.
Suppose f (1) = x, f (2) = y, f (3) = z, f (4) = y.
Since Im(f ) = {x, y, z} = B, f is onto.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 4 / 31
Im(f ) = B

Definition (Onto)
Let f : A ! B. The function f is said to be onto (surjective) if and only if for
any b 2 B, there exists a 2 A such that f (a) = b.
In other words,
f is onto if and only if Im(f ) = B.

Examples
Let A = {1, 2, 3, 4} and B = {x, y, z}.
Suppose f (1) = x, f (2) = y, f (3) = z, f (4) = y.
Since Im(f ) = {x, y, z} = B, f is onto.
Suppose g(1) = z, g(2) = y, g(3) = y, g(4) = z.
Since Im(g) = {y, z} is a proper subset of B, g is not onto.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 4 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not. To be onto, by the definition there should hold b 2 Im(f ) for
any b 2 Z.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not. To be onto, by the definition there should hold b 2 Im(f ) for
any b 2 Z.
b 2 Im(f ) $ b = 2a 3 for some a 2 Z

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not. To be onto, by the definition there should hold b 2 Im(f ) for
any b 2 Z.
b 2 Im(f ) $ b = 2a 3 for some a 2 Z
$ b = 2(a 2) + 1 for some a 2 Z

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not. To be onto, by the definition there should hold b 2 Im(f ) for
any b 2 Z.
b 2 Im(f ) $ b = 2a 3 for some a 2 Z
$ b = 2(a 2) + 1 for some a 2 Z
and this occurs if and only if b is odd. Thus, the image of f is the set of
odd integers. Since Im(f ) 6= Z, f is not onto.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not. To be onto, by the definition there should hold b 2 Im(f ) for
any b 2 Z.
b 2 Im(f ) $ b = 2a 3 for some a 2 Z
$ b = 2(a 2) + 1 for some a 2 Z
and this occurs if and only if b is odd. Thus, the image of f is the set of
odd integers. Since Im(f ) 6= Z, f is not onto.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f onto?

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not. To be onto, by the definition there should hold b 2 Im(f ) for
any b 2 Z.
b 2 Im(f ) $ b = 2a 3 for some a 2 Z
$ b = 2(a 2) + 1 for some a 2 Z
and this occurs if and only if b is odd. Thus, the image of f is the set of
odd integers. Since Im(f ) 6= Z, f is not onto.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f onto? Recalling that the
graph of f (x) = x2 5x + 5, x 2 R, is a parabola with vertex ( 52 , 54 ),
clearly any integer less than 1 is not in the image of f.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
onto or not. To be onto, by the definition there should hold b 2 Im(f ) for
any b 2 Z.
b 2 Im(f ) $ b = 2a 3 for some a 2 Z
$ b = 2(a 2) + 1 for some a 2 Z
and this occurs if and only if b is odd. Thus, the image of f is the set of
odd integers. Since Im(f ) 6= Z, f is not onto.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f onto? Recalling that the
graph of f (x) = x2 5x + 5, x 2 R, is a parabola with vertex ( 52 , 54 ),
clearly any integer less than 1 is not in the image of f. Alternatively, it
is easy to see that 0 is not in the image of f because x2 5x + 5 = 0 has
no integer solutions (Why?). Hence f is not onto.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 5 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f onto?

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 6 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f onto? If yes, then the equation
b = f (x) = 3x3 x has a solution in Z for every integer b.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 6 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f onto? If yes, then the equation
b = f (x) = 3x3 x has a solution in Z for every integer b. For example, b = 1
cannot be written this way: 1 = 3x3 x for some x implies x(3x2 1) = 1.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 6 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f onto? If yes, then the equation
b = f (x) = 3x3 x has a solution in Z for every integer b. For example, b = 1
cannot be written this way: 1 = 3x3 x for some x implies x(3x2 1) = 1.
But the only pairs of integers whose product is 1 are the pairs 1, 1 and 1, 1.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 6 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f onto? If yes, then the equation
b = f (x) = 3x3 x has a solution in Z for every integer b. For example, b = 1
cannot be written this way: 1 = 3x3 x for some x implies x(3x2 1) = 1.
But the only pairs of integers whose product is 1 are the pairs 1, 1 and 1, 1.
So here we would require x = 3x2 1 = 1 or x = 3x2 1 = 1, neither of
which is possible.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 6 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f onto? If yes, then the equation
b = f (x) = 3x3 x has a solution in Z for every integer b. For example, b = 1
cannot be written this way: 1 = 3x3 x for some x implies x(3x2 1) = 1.
But the only pairs of integers whose product is 1 are the pairs 1, 1 and 1, 1.
So here we would require x = 3x2 1 = 1 or x = 3x2 1 = 1, neither of
which is possible. The integer b = 1 is a counterexample to the assertion that
f is onto, so f is not onto.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 6 / 31
Example
Let f : R ! R be defined by f (x) = 3x3 x. Students of calculus should be
able plot the graph of f
2
1
f (x)

0
1
2
1 0.5 0 0.5 1
x

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 7 / 31
Example
Let f : R ! R be defined by f (x) = 3x3 x. Students of calculus should be
able plot the graph of f
2
1
f (x)

0
1
2
1 0.5 0 0.5 1
x
and we immediately see that f is onto.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 7 / 31
1-1
Definition (One-to-one)
Let f : A ! B. The function f is said to be one-to-one (injective) and write
shortly 1-1 if and only if di↵erent elements of A have di↵erent images: in
symbols,
f is 1 1 if and only if a1 6= a2 , then f (a1 ) 6= f (a2 )

equivalently (taking the contrapositive),


f is 1 1 if and only if f (a1 ) = f (a2 ), then a1 = a2

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 8 / 31
1-1
Definition (One-to-one)
Let f : A ! B. The function f is said to be one-to-one (injective) and write
shortly 1-1 if and only if di↵erent elements of A have di↵erent images: in
symbols,
f is 1 1 if and only if a1 6= a2 , then f (a1 ) 6= f (a2 )

equivalently (taking the contrapositive),


f is 1 1 if and only if f (a1 ) = f (a2 ), then a1 = a2

Examples
Let A = {1, 2, 3} and B = {x, y, z}.
Suppose f (1) = x, f (2) = y, f (3) = z.
This function is 1-1 because f (1), f (2), and f (3) are all di↵erent: if
f (a1 ) = f (a2 ), then a1 = a2

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 8 / 31
1-1
Definition (One-to-one)
Let f : A ! B. The function f is said to be one-to-one (injective) and write
shortly 1-1 if and only if di↵erent elements of A have di↵erent images: in
symbols,
f is 1 1 if and only if a1 6= a2 , then f (a1 ) 6= f (a2 )

equivalently (taking the contrapositive),


f is 1 1 if and only if f (a1 ) = f (a2 ), then a1 = a2

Examples
Let A = {1, 2, 3} and B = {x, y, z}.
Suppose f (1) = x, f (2) = y, f (3) = z.
This function is 1-1 because f (1), f (2), and f (3) are all di↵erent: if
f (a1 ) = f (a2 ), then a1 = a2
Suppose g(1) = z, g(2) = y, g(3) = y.
Since g(2) = g(3) (= y) but 2 6= 3, f is not 1-1.
Askar Dzhumadil’daev (Kazakh-BritishDiscrete
Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 8 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?
f (x1 ) = f (x2 ) $ x21 5x1 + 5 = x22 5x2 + 5

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?
f (x1 ) = f (x2 ) $ x21 5x1 + 5 = x22 5x2 + 5 $ x21 5x1 = x22 5x2

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?
f (x1 ) = f (x2 ) $ x21
5x1 + 5 = x22 5x2 + 5 $ x21 5x1 = x22 5x2
$ (x1 x2 )(x1 + x2 ) = 5(x1 x2 )

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?
f (x1 ) = f (x2 ) $ x21
5x1 + 5 = x22 5x2 + 5 $ x21 5x1 = x22 5x2
$ (x1 x2 )(x1 + x2 ) = 5(x1 x2 ) $ (x1 x2 )(x1 + x2 5) = 0

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?
f (x1 ) = f (x2 ) $ x21
5x1 + 5 = x22 5x2 + 5 $ x21 5x1 = x22 5x2
$ (x1 x2 )(x1 + x2 ) = 5(x1 x2 ) $ (x1 x2 )(x1 + x2 5) = 0 $
x1 x2 = 0 or x1 + x2 5 = 0.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?
f (x1 ) = f (x2 ) $ x21
5x1 + 5 = x22 5x2 + 5 $ x21 5x1 = x22 5x2
$ (x1 x2 )(x1 + x2 ) = 5(x1 x2 ) $ (x1 x2 )(x1 + x2 5) = 0 $
x1 x2 = 0 or x1 + x2 5 = 0.
For instance, x1 = 2, x2 = 3, we have f (2) = f (3).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
More examples

Examples
Let f : Z ! Z be defined by f (x) = 2x 3. Let us determine whether f is
1-1 or not. To be 1-1, by the definition there should hold
f (x1 ) = f (x2 ) ! x1 = x2 .
f (x1 ) = f (x2 ) $ 2x1 3 = 2x2 3 ! x1 = x2
Hence f is 1-1.
Define f : Z ! Z by f (x) = x2 5x + 5. Is f 1-1?
f (x1 ) = f (x2 ) $ x21
5x1 + 5 = x22 5x2 + 5 $ x21 5x1 = x22 5x2
$ (x1 x2 )(x1 + x2 ) = 5(x1 x2 ) $ (x1 x2 )(x1 + x2 5) = 0 $
x1 x2 = 0 or x1 + x2 5 = 0.
For instance, x1 = 2, x2 = 3, we have f (2) = f (3). Then we conclude that
f is not 1-1.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 9 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1?

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2 $ 3(x31 x32 ) (x1 x2 ) = 0

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2 $ 3(x31 x32 ) (x1 x2 ) = 0
$ 3(x1 x2 )(x21 + x1 x2 + x22 ) (x1 x2 ) = 0

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2 $ 3(x31 x32 ) (x1 x2 ) = 0
$ 3(x1 x2 )(x21 + x1 x2 + x22 ) (x1 x2 ) = 0
$ (x1 x2 )(x21 + x1 x2 + x22 13 ) = 0

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2 $ 3(x31 x32 ) (x1 x2 ) = 0
$ 3(x1 x2 )(x21 + x1 x2 + x22 ) (x1 x2 ) = 0
$ (x1 x2 )(x21 + x1 x2 + x22 13 ) = 0
$ x1 x2 = 0 or x21 + x1 x2 + x22 = 13

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2 $ 3(x31 x32 ) (x1 x2 ) = 0
$ 3(x1 x2 )(x21 + x1 x2 + x22 ) (x1 x2 ) = 0
$ (x1 x2 )(x21 + x1 x2 + x22 13 ) = 0
$ x1 x2 = 0 or x21 + x1 x2 + x22 = 13
1
Since x1 and x2 are integers, x21 + x1 x2 + x22 = 3 is impossible.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2 $ 3(x31 x32 ) (x1 x2 ) = 0
$ 3(x1 x2 )(x21 + x1 x2 + x22 ) (x1 x2 ) = 0
$ (x1 x2 )(x21 + x1 x2 + x22 13 ) = 0
$ x1 x2 = 0 or x21 + x1 x2 + x22 = 13
1
Since x1 and x2 are integers, x21 + x1 x2 + x22 = 3 is impossible. Thus, x1 = x2

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
Example
Define f : Z ! Z by f (x) = 3x3 x. Is f 1-1? Suppose f (x1 ) = f (x2 ) for
x1 , x2 2 Z. Then
3x31 x1 = 3x32 x2 $ 3(x31 x32 ) (x1 x2 ) = 0
$ 3(x1 x2 )(x21 + x1 x2 + x22 ) (x1 x2 ) = 0
$ (x1 x2 )(x21 + x1 x2 + x22 13 ) = 0
$ x1 x2 = 0 or x21 + x1 x2 + x22 = 13
1
Since x1 and x2 are integers, x21 + x1 x2 + x22 = 3 is impossible. Thus, x1 = x2
and f is 1-1.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 10 / 31
yota

Definition (bijective)
A function is called bijective if and only if it is both onto and 1-1.

Definition (Identity function)


For any set A, the identityf unction on A is the function ◆A : A ! A defined
by ◆A (a) = a for all a 2 A. In terms of ordered pairs,

◆A = {(a, a) | a 2 A}.
When there is no possibility of confusion about A, we will often write ◆, rather
than ◆A . (The Greek symbol ◆ is pronounced ”yota”, so that ”◆A ” is read
”yota sub A.”)

Example
The identity function on a set A is onto and 1-1, hence bijective.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 11 / 31
Questions for Self-Study

Let A and B be sets with m and n elements respectively.


How many functions are there from A to B?
How many one-to-one functions from are there from A to B?
How many onto functions from are there from A to B?
How many one-to-one and onto functions from are there from A to B?
Under what conditions on m and n are there no one-to-one or onto
functions from A to B?
Justify your answers in each case.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 12 / 31
1
f

Definition (Inverse function)


We say that a function f : A ! B has an inverse if and only if the set
obtained by reversing the ordered pairs of f is a function B ! A. If
f : A ! B has an inverse, the function
1
f = {(b, a) | (a, b) 2 f }

is called the inverse of f

Example
Let A = {1, 2, 3, 4} and B = {x, y, z, t}. Suppose

f = {(1, x), (2, y), (3, z), (4, t)}.

Reversing its pairs, we obtain a function from B to A


1
f = {(x, 1), (y, 2), (z, 3), (t, 4)}.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 13 / 31
Proposition
1
A function f : A ! B has an inverse f : B ! A if and only if f is
bijective (onto and 1-1)
If a function has an inverse, then it is unique

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 14 / 31
Proposition
1
A function f : A ! B has an inverse f : B ! A if and only if f is
bijective (onto and 1-1)
If a function has an inverse, then it is unique

For any function g, remember that (x, y) 2 g if and only if y = g(x);


In particular, (b, a) 2 f 1 if and only if a = f 1 (b).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 14 / 31
Proposition
1
A function f : A ! B has an inverse f : B ! A if and only if f is
bijective (onto and 1-1)
If a function has an inverse, then it is unique

For any function g, remember that (x, y) 2 g if and only if y = g(x);


In particular, (b, a) 2 f 1 if and only if a = f 1 (b).
Thus,
a = f 1 (b) $ (b, a) 2 f 1 $ (a, b) 2 f $ b = f (a).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 14 / 31
Proposition
1
A function f : A ! B has an inverse f : B ! A if and only if f is
bijective (onto and 1-1)
If a function has an inverse, then it is unique

For any function g, remember that (x, y) 2 g if and only if y = g(x);


In particular, (b, a) 2 f 1 if and only if a = f 1 (b).
Thus,
a = f 1 (b) $ (b, a) 2 f 1 $ (a, b) 2 f $ b = f (a).
The equivalence of the first and last equations here is very important
1
a=f (b) $ f (a) = b.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 14 / 31
Proposition
1
A function f : A ! B has an inverse f : B ! A if and only if f is
bijective (onto and 1-1)
If a function has an inverse, then it is unique

For any function g, remember that (x, y) 2 g if and only if y = g(x);


In particular, (b, a) 2 f 1 if and only if a = f 1 (b).
Thus,
a = f 1 (b) $ (b, a) 2 f 1 $ (a, b) 2 f $ b = f (a).
The equivalence of the first and last equations here is very important
1
a=f (b) $ f (a) = b.

Now we consider several examples of finding inverses of bijective functions


using last logical equivalence.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 14 / 31
More Examples

Examples
If f : R ! R is defined by f (x) = 2x 3, then f is 1-1 and onto, so an
inverse function exists. According to the last logical equivalence that was
obtained, if y = f 1 (x), then x = f (y) = 2y 3. Thus,
y = 12 (x + 3) = f 1 (x).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 15 / 31
More Examples

Examples
If f : R ! R is defined by f (x) = 2x 3, then f is 1-1 and onto, so an
inverse function exists. According to the last logical equivalence that was
obtained, if y = f 1 (x), then x = f (y) = 2y 3. Thus,
y = 12 (x + 3) = f 1 (x).
Let A = {x 2 R | x  0} and B = {x 2 R | x 0} and define f : A ! B by
f (x) = x2 . This is just the squaring function with domain restricted so
that it is 1-1 as well as onto. Since f is 1-1 and onto, it has an inverse. To
obtain f 1 (x), let y = f 1 (x), 2
p deduce that f (y) = x and so y = x.
Solvingp for y,1we get yp= ± x. Since x = f (y), y 2 A, so y  0. Thus,
y= x; f (x) = x.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 15 / 31
f g

Definition (Composition)
If f : A ! B and g : B ! C are functions, then the composition of f and g is
the function g f : A ! C defined by (g f )(a) = g(f (a)) for all a 2 A.

Examples
If A = {a, b, c}, B = {x, y} and C = {u, v, w}, and if f : A ! B and g : B ! C
are the functions
f = {(a, x), (b, y), (c, x)} and g = {(x, u), (y, w)},
then

(g f )(a) = g(f (a)) = g(x) = u,


(g f )(b) = g(f (b)) = g(y) = w,
(g f )(c) = g(f (c)) = g(x) = u,
and so g f = {(a, u), (b, w), (c, u)}.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 16 / 31
If f and g are the functions R ! R defined by

f (x) = 2x 3, g(x) = x2 + 1,
then both g f and f g are defined and we have
(g f )(x) = g(f (x)) = g(2x 3) = (2x 3)2 + 1

and
(f g)(x) = f (g(x)) = f (x2 + 1) = 2(x2 + 1) 3.
Thus, even when both f g and g f are defined, it is unlikely that
f g = g f.
In the definition of g f, it is required that Im(f ) ✓ B. If f : R ! R and
g : R\{1} ! R are the functions defined by
x
f (x) = 2x 3 and g(x) = x 1,

then g f is not defined because Im(f ) = R * D(g). On the other hand, f g


is defined and
(f g)(x) = 2( x x 1 ) 3.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 17 / 31
(f g) h = f (g h)

Definition (Equality of functions)


We say that functions f, g : A ! B are equal if and only if f (a) = g(a) for any
a 2 A.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 18 / 31
(f g) h = f (g h)

Definition (Equality of functions)


We say that functions f, g : A ! B are equal if and only if f (a) = g(a) for any
a 2 A.

Proposition
Composition of functions is an associative operation.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 18 / 31
(f g) h = f (g h)

Definition (Equality of functions)


We say that functions f, g : A ! B are equal if and only if f (a) = g(a) for any
a 2 A.

Proposition
Composition of functions is an associative operation.

Proof. Let f : A ! B, g : B ! C , h : C ! D. We need to show that


(f g) h = f (g h) whenever each side of this equation is defined. In this
case, each of (f g) h and f (g h) is a function A ! D, so we have only to
prove that ((f g) h)(a) = (f (g h))(a) for any a 2 A. For this, we have

((f g) h)(a) = (f g)(h(a))) = f (g(h(a)))


and
(f (g h))(a) = f ((g h)(a)) = f (g(h(a)))

as desired ⇤
Askar Dzhumadil’daev (Kazakh-BritishDiscrete
Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 18 / 31
Proposition
Functions f : A ! B and g : B ! A are inverses to each other if and only if
g f = ◆A and f g = ◆B ; that is, if and only if
g(f (a)) = a and f (g(b)) = b for all a 2 A and b 2 B.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 19 / 31
Proposition
Functions f : A ! B and g : B ! A are inverses to each other if and only if
g f = ◆A and f g = ◆B ; that is, if and only if
g(f (a)) = a and f (g(b)) = b for all a 2 A and b 2 B.

We leave its proof to students.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 19 / 31
Proposition
Functions f : A ! B and g : B ! A are inverses to each other if and only if
g f = ◆A and f g = ◆B ; that is, if and only if
g(f (a)) = a and f (g(b)) = b for all a 2 A and b 2 B.

We leave its proof to students.

Example
Let f : R ! (1, 1) and g : (1, 1) ! R defined

f (x) = 32x + 1 and g(x) = 12 log3 (x 1).


Let us show that they are inverses.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 19 / 31
Proposition
Functions f : A ! B and g : B ! A are inverses to each other if and only if
g f = ◆A and f g = ◆B ; that is, if and only if
g(f (a)) = a and f (g(b)) = b for all a 2 A and b 2 B.

We leave its proof to students.

Example
Let f : R ! (1, 1) and g : (1, 1) ! R defined

f (x) = 32x + 1 and g(x) = 12 log3 (x 1).


Let us show that they are inverses. For any x 2 R, (g f )(x) =
g(f (x)) = g(32x + 1) = 12 log3 ((32x + 1) 1) = 12 log3 (32x ) = 12 (2x) = x

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 19 / 31
Proposition
Functions f : A ! B and g : B ! A are inverses to each other if and only if
g f = ◆A and f g = ◆B ; that is, if and only if
g(f (a)) = a and f (g(b)) = b for all a 2 A and b 2 B.

We leave its proof to students.

Example
Let f : R ! (1, 1) and g : (1, 1) ! R defined

f (x) = 32x + 1 and g(x) = 12 log3 (x 1).


Let us show that they are inverses. For any x 2 R, (g f )(x) =
g(f (x)) = g(32x + 1) = 12 log3 ((32x + 1) 1) = 12 log3 (32x ) = 12 (2x) = x

for any x 2 (1, 1), (f g)(x) =


1
f (g(x)) = f ( 12 log3 (x 1)) = 32( 2 log3 (x 1))
+ 1 = 3log3 (x 1)
+ 1 = (x 1) + 1 = x.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 19 / 31
Proposition
Functions f : A ! B and g : B ! A are inverses to each other if and only if
g f = ◆A and f g = ◆B ; that is, if and only if
g(f (a)) = a and f (g(b)) = b for all a 2 A and b 2 B.

We leave its proof to students.

Example
Let f : R ! (1, 1) and g : (1, 1) ! R defined

f (x) = 32x + 1 and g(x) = 12 log3 (x 1).


Let us show that they are inverses. For any x 2 R, (g f )(x) =
g(f (x)) = g(32x + 1) = 12 log3 ((32x + 1) 1) = 12 log3 (32x ) = 12 (2x) = x

for any x 2 (1, 1), (f g)(x) =


1
f (g(x)) = f ( 12 log3 (x 1)) = 32( 2 log3 (x 1))
+ 1 = 3log3 (x 1)
+ 1 = (x 1) + 1 = x.

By the proposition above, f and g are inverses.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 19 / 31
Size of a Set or Cardinality

Now we start talking about the size of a set or more correctly, its cardinality.
We will study how to compare sets and figure out whether a set is “smaller”
or “larger” than other set.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 20 / 31
Size of a Set or Cardinality

Now we start talking about the size of a set or more correctly, its cardinality.
We will study how to compare sets and figure out whether a set is “smaller”
or “larger” than other set.

We say that sets A and B are in one-to-one correspondence or there is a


one-to-one correspondence between A and B if there is a 1-1 and onto function
between them.
a 7! x, b 7! y is a one-to-one correspondence between {a, b} and {x, y}.
The function f : N ! N [ {0} defined by f (n) = n 1 is a one-to-one
correspondence between N and N [ {0}.
The function f : Z ! 2Z defined by f (n) = 2n is a one-to-one
correspondence between Z and 2Z.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 20 / 31
Definitions
A finite set is a set that is either empty or in one-to-one correspondence with
the set {1, 2, 3, . . . , n} of the first n natural numbers, for some n 2 N. A set
that is not finite is called infinite. We define the cardinality of the empty set
to be 0 and write |;| = 0. If A is a nonempty finite set and in one-to-one
correspondence with {1, 2, 3, . . . , n}, we define the cardinality of A to be n and
write |A| = n.

Thus, if A is a nonempty finite set, its elements can be labeled a1 , a2 , . . . , an


for some n and the cardinality of A is n, the number of elements in A.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 21 / 31
Definitions
A finite set is a set that is either empty or in one-to-one correspondence with
the set {1, 2, 3, . . . , n} of the first n natural numbers, for some n 2 N. A set
that is not finite is called infinite. We define the cardinality of the empty set
to be 0 and write |;| = 0. If A is a nonempty finite set and in one-to-one
correspondence with {1, 2, 3, . . . , n}, we define the cardinality of A to be n and
write |A| = n.

Thus, if A is a nonempty finite set, its elements can be labeled a1 , a2 , . . . , an


for some n and the cardinality of A is n, the number of elements in A.

Examples
|{a, b, x}| = 3
|{x 2 R | x2 + 1 = 0}| = 0
The cardinality of the English alphabet is 26.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 21 / 31
|A| = |B|

How might we determine if two finite sets contain the same number of
elements? We could count the elements in each set, but if the sets were large,
this method would be slowly and highly unreliable.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 22 / 31
|A| = |B|

How might we determine if two finite sets contain the same number of
elements? We could count the elements in each set, but if the sets were large,
this method would be slowly and highly unreliable.

Definition
Sets A and B have same cardinality and we write |A| = |B|, if and only if
there is a one-to-one correspondence between them; that is, if and only if there
exists a one-to-one onto function from A to B (or from B to A)

Examples
|{a, b}| = |{x, y}|.
|N| = |N [ {0}|.
|Z| = |2Z|.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 22 / 31
Example: |R| = |R+ |

R and the
set R+ of positive reals have
the same cardinality, for
the function R ! R+ defined
by f (x) = 2x establishes
a one-to-one correspondence.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 23 / 31
Example: |(0, 1)| = |(1, 1)|

The function
1
(0, 1) ! (1, 1) defined by f (x) = x
shows that (0, 1) and (1, 1)
are in one-to-one correspondence.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 24 / 31
Example: |(0, 1)| = |(a, 1)|

Let a be any real number. We show that two sets (0, 1) and (a, 1) have the
same cardinality.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 25 / 31
Example: |(0, 1)| = |(a, 1)|

Let a be any real number. We show that two sets (0, 1) and (a, 1) have the
same cardinality. Define f : (0, 1) ! (a, 1) by
1
f (x) = x 1 + a.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 25 / 31
Example: |(0, 1)| = |(a, 1)|

Let a be any real number. We show that two sets (0, 1) and (a, 1) have the
same cardinality. Define f : (0, 1) ! (a, 1) by
1
f (x) = x 1 + a.
We claim that f establishes a one-to-one correspondence between (0, 1) and
(a, 1).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 25 / 31
Example: |(0, 1)| = |(a, 1)|

Let a be any real number. We show that two sets (0, 1) and (a, 1) have the
same cardinality. Define f : (0, 1) ! (a, 1) by
1
f (x) = x 1 + a.
We claim that f establishes a one-to-one correspondence between (0, 1) and
(a, 1). This function is one-to-one because
1 1 1 1
f (x1 ) = f (x2 ) ! x1 1+a= x2 1+a! x1 = x2 ! x1 = x2 .

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 25 / 31
Example: |(0, 1)| = |(a, 1)|

Let a be any real number. We show that two sets (0, 1) and (a, 1) have the
same cardinality. Define f : (0, 1) ! (a, 1) by
1
f (x) = x 1 + a.
We claim that f establishes a one-to-one correspondence between (0, 1) and
(a, 1). This function is one-to-one because
1 1 1 1
f (x1 ) = f (x2 ) ! x1 1+a= x2 1+a! x1 = x2 ! x1 = x2 .
To show f is onto, we have to show that any y > a is f (x) for some x 2 (0, 1).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 25 / 31
Example: |(0, 1)| = |(a, 1)|

Let a be any real number. We show that two sets (0, 1) and (a, 1) have the
same cardinality. Define f : (0, 1) ! (a, 1) by
1
f (x) = x 1 + a.
We claim that f establishes a one-to-one correspondence between (0, 1) and
(a, 1). This function is one-to-one because
1 1 1 1
f (x1 ) = f (x2 ) ! x1 1+a= x2 1+a! x1 = x2 ! x1 = x2 .
To show f is onto, we have to show that any y > a is f (x) for some x 2 (0, 1).
Now
1 1
y= x 1+a!x= y+1 a ,

which is in (0, 1) because y + 1 a > 1. Now we simply check that f (x) = y.


1
f (x) = 1 1 + a = (y + 1 a) 1 + a = y.
y+1 a

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 25 / 31
Example: |(0, 1)| = |(a, 1)|

Let a be any real number. We show that two sets (0, 1) and (a, 1) have the
same cardinality. Define f : (0, 1) ! (a, 1) by
1
f (x) = x 1 + a.
We claim that f establishes a one-to-one correspondence between (0, 1) and
(a, 1). This function is one-to-one because
1 1 1 1
f (x1 ) = f (x2 ) ! x1 1+a= x2 1+a! x1 = x2 ! x1 = x2 .
To show f is onto, we have to show that any y > a is f (x) for some x 2 (0, 1).
Now
1 1
y= x 1+a!x= y+1 a ,

which is in (0, 1) because y + 1 a > 1. Now we simply check that f (x) = y.


1
f (x) = 1 1 + a = (y + 1 a) 1 + a = y.
y+1 a

So f is indeed onto, and one-to-one correspondence.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 25 / 31
Example: |( 1, 2)| = |( 5, 4)|
We show that the intervals ( 1, 2) and ( 5, 4) have the same cardinality.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 26 / 31
Example: |( 1, 2)| = |( 5, 4)|
We show that the intervals ( 1, 2) and ( 5, 4) have the same cardinality.
In order to prove that the intervals have the same cardinality, we need to
define a one-to-one onto function f : ( 1, 2) ! ( 5, 4).

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 26 / 31
Example: |( 1, 2)| = |( 5, 4)|
We show that the intervals ( 1, 2) and ( 5, 4) have the same cardinality.
In order to prove that the intervals have the same cardinality, we need to
define a one-to-one onto function f : ( 1, 2) ! ( 5, 4).
We will construct a function f such that f ( 1) = 5 and f (2) = 4 whose
graph looks as follows.
4
f (x)

5
1 0 2
x

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 26 / 31
Example: |( 1, 2)| = |( 5, 4)|
We show that the intervals ( 1, 2) and ( 5, 4) have the same cardinality.
In order to prove that the intervals have the same cardinality, we need to
define a one-to-one onto function f : ( 1, 2) ! ( 5, 4).
We will construct a function f such that f ( 1) = 5 and f (2) = 4 whose
graph looks as follows.
4
f (x)

5
1 0 2
x
As we see from the graph that it is a graph of a straight line passing through
the points ( 1, 5) and (2, 4). It is easy to understand that increasing straight
lines are onto and one-to-one. So its equation is f (x) = 3x 2 (Why?). Thus
f is a one-to-one correspondence between ( 1, 2) and ( 5, 4).
Hence |( 1, 2)| = |( 5, 4)|.
Askar Dzhumadil’daev (Kazakh-BritishDiscrete
Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 26 / 31
@0 “Aleph naught”

Definition (Countable)
A set A is countably infinite if and only if |A| = |N| and countable if and only
if it is either finite or countably infinite. A set that is not countable is
uncountable.
The symbol @0 (pronounced “aleph naught”) has traditionally been used to
denote the cardinality of the natural numbers. Thus, a countably infinite sets
has cardinality @0 . As the name suggests, countably infinte sets are those
whose elements can be listed in a systematic and definite way, because to list
them is to rank them as first, second, third, and so on, and this ranking
establishes the required one-to-one correspondence with N.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 27 / 31
|Z| = @0
We show that |Z| = @0 , in other words, |Z| = |N|. The set of integers is
infinite. To show it is countably infinite, we list its elements

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 28 / 31
|Z| = @0
We show that |Z| = @0 , in other words, |Z| = |N|. The set of integers is
infinite. To show it is countably infinite, we list its elements

f: N ! Z
1 7 ! 0
2 7 ! 1
3 7 ! 1
4 7 ! 2
5 7 ! 2
6 7 ! 3
7 7 ! 3
··· ··· ···

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 28 / 31
|Z| = @0
We show that |Z| = @0 , in other words, |Z| = |N|. The set of integers is
infinite. To show it is countably infinite, we list its elements

f: N ! Z
1 7 ! 0
2 7 ! 1
3 7 ! 1
4 7 ! 2
5 7 ! 2
6 7 ! 3
7 7 ! 3
··· ··· ···

defined by ⇢ 1
f (n) = 2n if n is even
1
2 (n 1) if n is odd
which is certainly both one-to-one and onto.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 28 / 31
|Z| = @0
We show that |Z| = @0 , in other words, |Z| = |N|. The set of integers is
infinite. To show it is countably infinite, we list its elements

f: N ! Z
1 7 ! 0
2 7 ! 1
3 7 ! 1
4 7 ! 2
5 7 ! 2
6 7 ! 3
7 7 ! 3
··· ··· ···

defined by ⇢ 1
f (n) = 2n if n is even
1
2 (n 1) if n is odd
which is certainly both one-to-one and onto.
One can also write it as f (n) = 14 (1 + ( 1)n (2n 1)) (Why?).
Askar Dzhumadil’daev (Kazakh-BritishDiscrete
Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 28 / 31
|N ⇥ N| = @0

Consider
the set N ⇥ N = {(a, b) | a, b 2 N}.
The elements of N ⇥ N can
be systematically listed by starting
at (1, 1) and following the arrows.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 29 / 31
Questions for Self-Study

Which of these sets Q, Z ⇥ Z, (0, 1) and R are countable? Why?

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 30 / 31
Questions for Self-Study

Which of these sets Q, Z ⇥ Z, (0, 1) and R are countable? Why?


For any two sets A and B, we define |A|  |B| if and only if there is a
one-to-one function A ! B, and we define |A| < |B| if and only if
|A|  |B|, but |A| =
6 |B|.

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 30 / 31
Questions for Self-Study

Which of these sets Q, Z ⇥ Z, (0, 1) and R are countable? Why?


For any two sets A and B, we define |A|  |B| if and only if there is a
one-to-one function A ! B, and we define |A| < |B| if and only if
|A|  |B|, but |A| =
6 |B|.
Determine the equality and inequality relations between the following sets:
{1, 2, . . . , n} N Z ( 1, 2) (1, 1)
N⇥N Q Z⇥Z (0, 1) R

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 30 / 31
The End of Lecture 3

Askar Dzhumadil’daev (Kazakh-BritishDiscrete


Technical
Mathematics
University) Lecture 3 - Functions July 23, 2020 31 / 31

You might also like