discrete mathematics and its...
TRANSCRIPT
Discrete Mathematics and Its ApplicationsLecture 2: Basic Structures: Function
MING GAO
DaSE@ ECNU(for course related communications)
Mar. 27, 2020
Outline
1 Function
2 One-to-one and onto functions
3 Inverse Functions and Compositions of Functions
4 Some important functions
5 Take-aways
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 2 / 25
Function
Motivations
Classifier
Moore’s law Complexity analysis
Motivations
Functions connect the relationships between different objects;
A function may tell us a rule;
Models in data mining, machine learning, etc., are usuallypresented in functions.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 3 / 25
Function
Motivations
Classifier Moore’s law
Complexity analysis
Motivations
Functions connect the relationships between different objects;
A function may tell us a rule;
Models in data mining, machine learning, etc., are usuallypresented in functions.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 3 / 25
Function
Motivations
Classifier Moore’s law Complexity analysis
Motivations
Functions connect the relationships between different objects;
A function may tell us a rule;
Models in data mining, machine learning, etc., are usuallypresented in functions.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 3 / 25
Function
Function
Definition
Let A and B be nonempty sets. A function f from A to B is anassignment of exactly one element of B to each element of A. Wewrite f (a) = b if b is the unique element of B assigned by function fto element a of A. If f is a function from A to B, we write f : A→ B.
Functions are sometimes also called mappings or transformations;
Functions are specified in many different ways, such as assignmentrules, formula, relations, etc;
This function is defined by assignment f (a) = b, where (a, b) is theunique ordered pair in the relation that has a as its first element.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 4 / 25
Function
Function
Definition
Let A and B be nonempty sets. A function f from A to B is anassignment of exactly one element of B to each element of A. Wewrite f (a) = b if b is the unique element of B assigned by function fto element a of A. If f is a function from A to B, we write f : A→ B.
Functions are sometimes also called mappings or transformations;
Functions are specified in many different ways, such as assignmentrules, formula, relations, etc;
This function is defined by assignment f (a) = b, where (a, b) is theunique ordered pair in the relation that has a as its first element.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 4 / 25
Function
Function
Definition
Let A and B be nonempty sets. A function f from A to B is anassignment of exactly one element of B to each element of A. Wewrite f (a) = b if b is the unique element of B assigned by function fto element a of A. If f is a function from A to B, we write f : A→ B.
Functions are sometimes also called mappings or transformations;
Functions are specified in many different ways, such as assignmentrules, formula, relations, etc;
This function is defined by assignment f (a) = b, where (a, b) is theunique ordered pair in the relation that has a as its first element.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 4 / 25
Function
Function
Definition
Let A and B be nonempty sets. A function f from A to B is anassignment of exactly one element of B to each element of A. Wewrite f (a) = b if b is the unique element of B assigned by function fto element a of A. If f is a function from A to B, we write f : A→ B.
Functions are sometimes also called mappings or transformations;
Functions are specified in many different ways, such as assignmentrules, formula, relations, etc;
This function is defined by assignment f (a) = b, where (a, b) is theunique ordered pair in the relation that has a as its first element.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 4 / 25
Function
Function
Definition
Let A and B be nonempty sets. A function f from A to B is anassignment of exactly one element of B to each element of A. Wewrite f (a) = b if b is the unique element of B assigned by function fto element a of A. If f is a function from A to B, we write f : A→ B.
Functions are sometimes also called mappings or transformations;
Functions are specified in many different ways, such as assignmentrules, formula, relations, etc;
This function is defined by assignment f (a) = b, where (a, b) is theunique ordered pair in the relation that has a as its first element.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 4 / 25
Function
Domain and codomain
Definition
If f is a function from A to B, we say that A is the domain of f andB is the codomain of f . If f (a) = b, we say that b is the image ofa and a is a preimage of b. The range, or image, of f is the set ofall images of elements of A. Also, if f is a function from A to B, wesay that f maps A to B.
Let g be the function that assigns a grade to a student in ourdiscrete mathematics class. Note that g(Adams) = A, forinstance.
The domain of g is set{Adams,Chou,Goodfriend ,Rodriguez ,Stevens}, and thecodomain is set {A,B,C ,D,F}.The range of g is set {A,B,C ,F}, because each grade exceptD is assigned to some students.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 5 / 25
Function
Domain and codomain
Definition
If f is a function from A to B, we say that A is the domain of f andB is the codomain of f . If f (a) = b, we say that b is the image ofa and a is a preimage of b. The range, or image, of f is the set ofall images of elements of A. Also, if f is a function from A to B, wesay that f maps A to B.
Let g be the function that assigns a grade to a student in ourdiscrete mathematics class. Note that g(Adams) = A, forinstance.
The domain of g is set{Adams,Chou,Goodfriend ,Rodriguez ,Stevens}, and thecodomain is set {A,B,C ,D,F}.The range of g is set {A,B,C ,F}, because each grade exceptD is assigned to some students.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 5 / 25
Function
Domain and codomain
Definition
If f is a function from A to B, we say that A is the domain of f andB is the codomain of f . If f (a) = b, we say that b is the image ofa and a is a preimage of b. The range, or image, of f is the set ofall images of elements of A. Also, if f is a function from A to B, wesay that f maps A to B.
Let g be the function that assigns a grade to a student in ourdiscrete mathematics class. Note that g(Adams) = A, forinstance.
The domain of g is set{Adams,Chou,Goodfriend ,Rodriguez ,Stevens}, and thecodomain is set {A,B,C ,D,F}.
The range of g is set {A,B,C ,F}, because each grade exceptD is assigned to some students.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 5 / 25
Function
Domain and codomain
Definition
If f is a function from A to B, we say that A is the domain of f andB is the codomain of f . If f (a) = b, we say that b is the image ofa and a is a preimage of b. The range, or image, of f is the set ofall images of elements of A. Also, if f is a function from A to B, wesay that f maps A to B.
Let g be the function that assigns a grade to a student in ourdiscrete mathematics class. Note that g(Adams) = A, forinstance.
The domain of g is set{Adams,Chou,Goodfriend ,Rodriguez ,Stevens}, and thecodomain is set {A,B,C ,D,F}.The range of g is set {A,B,C ,F}, because each grade exceptD is assigned to some students.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 5 / 25
Function
Add and product
Definition
Let f1 and f2 be functions from A to R. Then f1 + f2 and f1f2 arealso functions from A to R defined for all x ∈ A by
(f1 + f2)(x) = f1(x) + f2(x),
(f1f2)(x) = f1(x)f2(x).
Example
Let f1 and f2 be functions from R to R such that f1(x) = (x + 1)2
and f2(x) = −(x − 1)2. Thus, we have
(f1 + f2)(x) = f1(x) + f2(x) = (x + 1)2 − (x − 1)2 = 4x ,
(f1f2)(x) = f1(x)f2(x) = −(x + 1)2(x − 1)2 = −(x2 − 1)2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 6 / 25
Function
Add and product
Definition
Let f1 and f2 be functions from A to R. Then f1 + f2 and f1f2 arealso functions from A to R defined for all x ∈ A by
(f1 + f2)(x) = f1(x) + f2(x),
(f1f2)(x) = f1(x)f2(x).
Example
Let f1 and f2 be functions from R to R such that f1(x) = (x + 1)2
and f2(x) = −(x − 1)2. Thus, we have
(f1 + f2)(x) = f1(x) + f2(x) = (x + 1)2 − (x − 1)2 = 4x ,
(f1f2)(x) = f1(x)f2(x) = −(x + 1)2(x − 1)2 = −(x2 − 1)2.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 6 / 25
Function
Projection
Definition
Let f be a function from A to B and let S be a subset of A. Theimage of S under f is the subset of B that consists of the images ofthe elements of S . We denote the image of S by f (S), so
f (S) = {t|∀s ∈ S , t = f (s)}.
Example
Let f (x) be function from R to R such that f (x) = x + 1, and Z bethe set of integers. Then
f (Z ) = Z .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 7 / 25
Function
Projection
Definition
Let f be a function from A to B and let S be a subset of A. Theimage of S under f is the subset of B that consists of the images ofthe elements of S . We denote the image of S by f (S), so
f (S) = {t|∀s ∈ S , t = f (s)}.
Example
Let f (x) be function from R to R such that f (x) = x + 1, and Z bethe set of integers. Then
f (Z ) = Z .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 7 / 25
One-to-one and onto functions
One-to-one function
Definition
A function f is said to be one-to-one, or an injunction, if and only iff (a) = f (b) implies that a = b for all a and b in the domain of f . Afunction is said to be injective if it is one-to-one.
Injunctive function
Remark: f is one-to-one ⇔ ∀a∀b(f (a) = f (b) → a = b) or∀a∀b(a 6= b → f (a) 6= f (b)).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 8 / 25
One-to-one and onto functions
One-to-one function
Definition
A function f is said to be one-to-one, or an injunction, if and only iff (a) = f (b) implies that a = b for all a and b in the domain of f . Afunction is said to be injective if it is one-to-one.
Injunctive function
Remark: f is one-to-one ⇔ ∀a∀b(f (a) = f (b) → a = b) or∀a∀b(a 6= b → f (a) 6= f (b)).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 8 / 25
One-to-one and onto functions
Onto function
Definition
A function f from A to B is called onto, or a surjection, if and onlyif for every element b ∈ B there is an element a ∈ A with f (a) = b.A function f is called surjective if it is onto.
Surjective function
Remark: A function f is onto if ∀y∃x(f (x) = y).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 9 / 25
One-to-one and onto functions
Onto function
Definition
A function f from A to B is called onto, or a surjection, if and onlyif for every element b ∈ B there is an element a ∈ A with f (a) = b.A function f is called surjective if it is onto.
Surjective function
Remark: A function f is onto if ∀y∃x(f (x) = y).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 9 / 25
One-to-one and onto functions
Monotonicity
Definition
A function f whose domain and codomain are subsets of the set ofreal numbers is called increasing if f (x) ≤ f (y), and strictly increas-ing if f (x) < f (y), whenever x < y and x and y are in the domainof f . Similarly, f is called decreasing if f (x) ≥ f (y), and strictlydecreasing if f (x) > f (y), whenever x < y and x and y are in thedomain of f .
Remarks
A function f is increasing if ∀x∀y(x < y → f (x) ≤ f (y)),strictly increasing if ∀x∀y(x < y → f (x) < f (y));
A function f is decreasing if ∀x∀y(x < y → f (x) ≥ f (y)),strictly increasing if ∀x∀y(x < y → f (x) > f (y)).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 10 / 25
One-to-one and onto functions
Monotonicity
Definition
A function f whose domain and codomain are subsets of the set ofreal numbers is called increasing if f (x) ≤ f (y), and strictly increas-ing if f (x) < f (y), whenever x < y and x and y are in the domainof f . Similarly, f is called decreasing if f (x) ≥ f (y), and strictlydecreasing if f (x) > f (y), whenever x < y and x and y are in thedomain of f .
Remarks
A function f is increasing if ∀x∀y(x < y → f (x) ≤ f (y)),strictly increasing if ∀x∀y(x < y → f (x) < f (y));
A function f is decreasing if ∀x∀y(x < y → f (x) ≥ f (y)),strictly increasing if ∀x∀y(x < y → f (x) > f (y)).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 10 / 25
Inverse Functions and Compositions of Functions
One-to-one correspondence
Definition
Function f is a one-to-one correspondence, or a bijection, if it is bothone-to-one and onto. We also say that such a function is bijective.
Remarks
Remarks: f is a one-to-one correspondence if and only if ⇔∀a∀b(a = b ↔ f (a) = f (b)).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 11 / 25
Inverse Functions and Compositions of Functions
One-to-one correspondence
Definition
Function f is a one-to-one correspondence, or a bijection, if it is bothone-to-one and onto. We also say that such a function is bijective.
Remarks
Remarks: f is a one-to-one correspondence if and only if ⇔∀a∀b(a = b ↔ f (a) = f (b)).
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 11 / 25
Inverse Functions and Compositions of Functions
Inverse function
Definition
Let f be a one-to-one correspondence from set A to set B. Theinverse function of f is the function that assigns an element b ∈ Bto a unique element a ∈ A such that f (a) = b. The inverse functionof f is denoted by f −1. Hence, f −1(b) = a when f (a) = b.
Remarks
Remarks:
f −1 6= 1f ;
A one-to-onecorrespondence is calledinvertible because we candefine an inverse of thisfunction.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 12 / 25
Inverse Functions and Compositions of Functions
Inverse function
Definition
Let f be a one-to-one correspondence from set A to set B. Theinverse function of f is the function that assigns an element b ∈ Bto a unique element a ∈ A such that f (a) = b. The inverse functionof f is denoted by f −1. Hence, f −1(b) = a when f (a) = b.
Remarks
Remarks:
f −1 6= 1f ;
A one-to-onecorrespondence is calledinvertible because we candefine an inverse of thisfunction.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 12 / 25
Inverse Functions and Compositions of Functions
Inverse function
Definition
Let f be a one-to-one correspondence from set A to set B. Theinverse function of f is the function that assigns an element b ∈ Bto a unique element a ∈ A such that f (a) = b. The inverse functionof f is denoted by f −1. Hence, f −1(b) = a when f (a) = b.
Remarks
Remarks:
f −1 6= 1f ;
A one-to-onecorrespondence is calledinvertible because we candefine an inverse of thisfunction.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 12 / 25
Inverse Functions and Compositions of Functions
Composition of functions
Definition
Let g be a function from set A to set B and let f be a function fromset B to set C . The composition of functions f and g , denoted forall a ∈ A by f ◦ g , is defined by
(f ◦ g)(a) = f (g(a)).
Remarks
Remarks: The com-mutative law does nothold for the composi-tion of functions, i.e.,
f ◦ g 6= g ◦ f .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 13 / 25
Inverse Functions and Compositions of Functions
Composition of functions
Definition
Let g be a function from set A to set B and let f be a function fromset B to set C . The composition of functions f and g , denoted forall a ∈ A by f ◦ g , is defined by
(f ◦ g)(a) = f (g(a)).
Remarks
Remarks: The com-mutative law does nothold for the composi-tion of functions, i.e.,
f ◦ g 6= g ◦ f .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 13 / 25
Inverse Functions and Compositions of Functions
Composition of functions
Definition
Let g be a function from set A to set B and let f be a function fromset B to set C . The composition of functions f and g , denoted forall a ∈ A by f ◦ g , is defined by
(f ◦ g)(a) = f (g(a)).
Remarks
Remarks: The com-mutative law does nothold for the composi-tion of functions, i.e.,
f ◦ g 6= g ◦ f .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 13 / 25
Inverse Functions and Compositions of Functions
Examples
Example I
Let f (x) = 2x + 3 and g(x) = 3x + 2 from Z to Z . What is thecomposition of f and g? What is the composition of g and f ?
(f ◦ g)(x) = f (g(x)) = f (3x + 2) = 2(3x + 2) + 3 = 6x + 7;
(g ◦ f )(x)
Example II
If f (x) = 3x + 2 and g(x) = 13x −
23 , how about the answers?
(f ◦ g)(x) = f (g(x)) = f (13x −23) = 3(13x −
23) + 2 = x ;
(g ◦ f )(x) = g(f (x)) = g(3x + 2) = 13(3x + 2)− 2
3 = x .
Remarks:
(f ◦ f −1)(b) = f (f −1(b)) = f (a) = b, i.e., (f ◦ f −1) = IB ;
(f −1 ◦ f )(a) = f −1(f (a)) = f −1(b) = a, i.e., (f −1 ◦ f ) = IA.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 14 / 25
Inverse Functions and Compositions of Functions
Examples
Example I
Let f (x) = 2x + 3 and g(x) = 3x + 2 from Z to Z . What is thecomposition of f and g? What is the composition of g and f ?
(f ◦ g)(x) = f (g(x)) = f (3x + 2) = 2(3x + 2) + 3 = 6x + 7;
(g ◦ f )(x)
Example II
If f (x) = 3x + 2 and g(x) = 13x −
23 , how about the answers?
(f ◦ g)(x) = f (g(x)) = f (13x −23) = 3(13x −
23) + 2 = x ;
(g ◦ f )(x) = g(f (x)) = g(3x + 2) = 13(3x + 2)− 2
3 = x .
Remarks:
(f ◦ f −1)(b) = f (f −1(b)) = f (a) = b, i.e., (f ◦ f −1) = IB ;
(f −1 ◦ f )(a) = f −1(f (a)) = f −1(b) = a, i.e., (f −1 ◦ f ) = IA.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 14 / 25
Inverse Functions and Compositions of Functions
Inverse of composition of functions
Theorem
Let f and g be invertible functions such that their composition f ◦ gis well defined. Then f ◦ g is invertible and (f ◦ g)−1 = g−1 ◦ f −1.
Proof.
Let A, B, and C be sets such that g : A→ B and f : B → C .Then the following two equations must be shown to hold:(g−1 ◦ f −1) ◦ (f ◦ g) = IA, and (f ◦ g) ◦ (g−1 ◦ f −1) = IB .
In terms of associative rule for function composition (homework),we have
(g−1 ◦ f −1) ◦ (f ◦ g) = g−1 ◦ ((f −1 ◦ f ) ◦ g)
= g−1 ◦ (IB ◦ g)
= g−1 ◦ g = IA
Similarly, we have (f ◦ g) ◦ (g−1 ◦ f −1) = IB .
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 15 / 25
Inverse Functions and Compositions of Functions
Inverse of composition of functions
Theorem
Let f and g be invertible functions such that their composition f ◦ gis well defined. Then f ◦ g is invertible and (f ◦ g)−1 = g−1 ◦ f −1.
Proof.
Let A, B, and C be sets such that g : A→ B and f : B → C .Then the following two equations must be shown to hold:(g−1 ◦ f −1) ◦ (f ◦ g) = IA, and (f ◦ g) ◦ (g−1 ◦ f −1) = IB .In terms of associative rule for function composition (homework),we have
(g−1 ◦ f −1) ◦ (f ◦ g) = g−1 ◦ ((f −1 ◦ f ) ◦ g)
= g−1 ◦ (IB ◦ g)
= g−1 ◦ g = IA
Similarly, we have (f ◦ g) ◦ (g−1 ◦ f −1) = IB .MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 15 / 25
Inverse Functions and Compositions of Functions
Graph of functions
Definition
Let f be a function from set A to set B. The graph of function f isthe set of ordered pairs
{(a, b)|a ∈ A ∧ f (a) = b}.
Examples
f (n) = 2n + 1 from Z to Z f (x) = x2 + 1 from Z to Z
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 16 / 25
Inverse Functions and Compositions of Functions
Graph of functions
Definition
Let f be a function from set A to set B. The graph of function f isthe set of ordered pairs
{(a, b)|a ∈ A ∧ f (a) = b}.
Examples
f (n) = 2n + 1 from Z to Z f (x) = x2 + 1 from Z to ZMING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 16 / 25
Some important functions
Some important functions——Floor and ceiling functions
Definition
The floor function assigns to a real number x the largestinteger that is less than or equal to x . The value of the floorfunction at x is denoted by bxc;The ceiling function assigns to a real number x the smallestinteger that is greater than or equal to x . The value of theceiling function at x is denoted by dxe.
Remarks
bxc = max {m ∈ Z : m ≤ x};dxe = min {m ∈ Z : m ≥ x}.There are many applications, including data transmission, anddata storage, etc;
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 17 / 25
Some important functions
Some important functions——Floor and ceiling functions
Definition
The floor function assigns to a real number x the largestinteger that is less than or equal to x . The value of the floorfunction at x is denoted by bxc;The ceiling function assigns to a real number x the smallestinteger that is greater than or equal to x . The value of theceiling function at x is denoted by dxe.
Remarks
bxc = max {m ∈ Z : m ≤ x};dxe = min {m ∈ Z : m ≥ x}.There are many applications, including data transmission, anddata storage, etc;
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 17 / 25
Some important functions
Graphs of floor and ceiling functions
Graphs
Floor function Ceiling function
Examples
b12c = 0, d12e = 1;
b−12c = −1, d−1
2e = 0;
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 18 / 25
Some important functions
Graphs of floor and ceiling functions
Graphs
Floor function Ceiling function
Examples
b12c = 0, d12e = 1;
b−12c = −1, d−1
2e = 0;
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 18 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;
d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;
bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Useful properties of floor and ceiling functions
Properties
Let n be an integer, x be a real number.
bxc = n if and only if n ≤ x < n + 1;
dxe = n if and only if n − 1 < x ≤ n;
bxc = n if and only if x − 1 < n ≤ x ;
dxe = n if and only if x ≤ n < x + 1;
x − 1 < bxc ≤ x ≤ dxe < x + 1;
b−xc = −dxe;d−xe = −bxc;bx + nc = bxc+ n;
dx + ne = dxe+ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 19 / 25
Some important functions
Example
Theorm
Prove that if x is a real number, then b2xc = bxc+ bx + 12c.
Proof.
Let x = n + ε, where n is an integer, and 0 ≤ ε < 1, i.e., bxc = n.
If 0 ≤ ε < 12 . In this case, 2x = 2n + 2ε and b2xc = 2n. We
also have bx + 12c = n since 0 < ε+ 1
2 < 1. Consequently,b2xc = bxc+ bx + 1
2c.If 1
2 ≤ ε < 1. In this case, 2x = 2n + 2ε = (2n + 1) + (2ε− 1)since 0 ≤ 2ε− 1 < 1, i.e., b2xc = 2n + 1. Becausebx + 1
2c = bn + 1 + (ε− 12)c = n + 1 since 0 ≤ ε− 1
2 < 1.Therefore, b2xc = 2n + 1 = n + (n + 1) = bxc+ bx + 1
2c.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 20 / 25
Some important functions
Example
Theorm
Prove that if x is a real number, then b2xc = bxc+ bx + 12c.
Proof.
Let x = n + ε, where n is an integer, and 0 ≤ ε < 1, i.e., bxc = n.
If 0 ≤ ε < 12 . In this case, 2x = 2n + 2ε and b2xc = 2n. We
also have bx + 12c = n since 0 < ε+ 1
2 < 1. Consequently,b2xc = bxc+ bx + 1
2c.
If 12 ≤ ε < 1. In this case, 2x = 2n + 2ε = (2n + 1) + (2ε− 1)
since 0 ≤ 2ε− 1 < 1, i.e., b2xc = 2n + 1. Becausebx + 1
2c = bn + 1 + (ε− 12)c = n + 1 since 0 ≤ ε− 1
2 < 1.Therefore, b2xc = 2n + 1 = n + (n + 1) = bxc+ bx + 1
2c.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 20 / 25
Some important functions
Example
Theorm
Prove that if x is a real number, then b2xc = bxc+ bx + 12c.
Proof.
Let x = n + ε, where n is an integer, and 0 ≤ ε < 1, i.e., bxc = n.
If 0 ≤ ε < 12 . In this case, 2x = 2n + 2ε and b2xc = 2n. We
also have bx + 12c = n since 0 < ε+ 1
2 < 1. Consequently,b2xc = bxc+ bx + 1
2c.If 1
2 ≤ ε < 1. In this case, 2x = 2n + 2ε = (2n + 1) + (2ε− 1)since 0 ≤ 2ε− 1 < 1, i.e., b2xc = 2n + 1. Becausebx + 1
2c = bn + 1 + (ε− 12)c = n + 1 since 0 ≤ ε− 1
2 < 1.Therefore, b2xc = 2n + 1 = n + (n + 1) = bxc+ bx + 1
2c.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 20 / 25
Some important functions
Some important functions——Indicator function
Definition
The indicator function of a subset A of set S is a function
IA : X → {0, 1},
defined as
IA(x) :=
{1, if x ∈ A;0, else.
Example
A = {(x , y) : x2 + y2 ≤ 1 ∧ x ≥ 0 ∧ y ≥ 0}, andS = {(x , y) : 1 ≥ x ≥ 0 ∧ 1 ≥ y ≥ 0}∀Pi ∈ S , we define IA(Pi ) and IS−A(Pi );
π ≈ 4∑n
i=1 IA(Pi )∑ni=1 IA(Pi )+
∑ni=1 IS−A(Pi )
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 21 / 25
Some important functions
Some important functions——Indicator function
Definition
The indicator function of a subset A of set S is a function
IA : X → {0, 1},
defined as
IA(x) :=
{1, if x ∈ A;0, else.
Example
A = {(x , y) : x2 + y2 ≤ 1 ∧ x ≥ 0 ∧ y ≥ 0}, andS = {(x , y) : 1 ≥ x ≥ 0 ∧ 1 ≥ y ≥ 0}∀Pi ∈ S , we define IA(Pi ) and IS−A(Pi );
π ≈ 4∑n
i=1 IA(Pi )∑ni=1 IA(Pi )+
∑ni=1 IS−A(Pi )
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 21 / 25
Some important functions
Some important functions——Indicator function
Definition
The indicator function of a subset A of set S is a function
IA : X → {0, 1},
defined as
IA(x) :=
{1, if x ∈ A;0, else.
Example
A = {(x , y) : x2 + y2 ≤ 1 ∧ x ≥ 0 ∧ y ≥ 0}, andS = {(x , y) : 1 ≥ x ≥ 0 ∧ 1 ≥ y ≥ 0}∀Pi ∈ S , we define IA(Pi ) and IS−A(Pi );
π ≈ 4∑n
i=1 IA(Pi )∑ni=1 IA(Pi )+
∑ni=1 IS−A(Pi )
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 21 / 25
Some important functions
Set covering problem
Input
Universal set U ={u1, u2, · · · , un}Subsets S1,S2, · · · , Sm ⊆ UCost c1, c2, · · · , cm
Goal
Find a set S = {Si :i ∈ I} that minimizes∑
i∈I ci ,such that
⋃i∈I Si = U
Solution
Let xi = ISi =
{1, if Si ∈ S;0, else.
, yij = Iui =
{1, if ui ∈ Sj ;0, else.
Objective: min∑m
j=1 xjs.t.
∑mj=1 xjyij ≥ 1.
xi ∈ {0, 1}, and yij ∈ {0, 1}where 1 ≤ j ≤ m and 1 ≤ i ≤ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 22 / 25
Some important functions
Set covering problem
Input
Universal set U ={u1, u2, · · · , un}Subsets S1,S2, · · · , Sm ⊆ UCost c1, c2, · · · , cm
Goal
Find a set S = {Si :i ∈ I} that minimizes∑
i∈I ci ,such that
⋃i∈I Si = U
Solution
Let xi = ISi =
{1, if Si ∈ S;0, else.
, yij = Iui =
{1, if ui ∈ Sj ;0, else.
Objective: min∑m
j=1 xjs.t.
∑mj=1 xjyij ≥ 1.
xi ∈ {0, 1}, and yij ∈ {0, 1}where 1 ≤ j ≤ m and 1 ≤ i ≤ n
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 22 / 25
Some important functions
Some important functions——Sigmoid functions
Definition
A sigmoid function is a mathematical function having a characteristic“S”-shaped curve or sigmoid curve. For example S(x) = 1
1+e−x .
Logistic function
Graphs General form
f (x) =L
1 + e−k(x−x0),
where x0 is the x-value of the sig-moid’s midpoint, L is the maximumvalue, and k is the steepness of thecurve.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 23 / 25
Some important functions
Some important functions——Sigmoid functions
Definition
A sigmoid function is a mathematical function having a characteristic“S”-shaped curve or sigmoid curve. For example S(x) = 1
1+e−x .
Logistic function
Graphs General form
f (x) =L
1 + e−k(x−x0),
where x0 is the x-value of the sig-moid’s midpoint, L is the maximumvalue, and k is the steepness of thecurve.
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 23 / 25
Some important functions
Some important functions——Sigmoid functions
Applications
Binary classification in logistic regression model;
Activation function in artificial neurons;
Cumulative distribution function in statistics.
Other forms
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 24 / 25
Take-aways
Take-aways
Conclusions
Function
One-to-one and onto functions
Inverse functions and compositions of functions
Some important functions
MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Mar. 27, 2020 25 / 25