410 likes | 635 Vues
chapter 2 Mathematical preliminaries. 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and Binomial Coefficients 2.6 The Pigeonhole Principle 2.7 Summations 2.8 Recurrence Relations. Concept of Set. 2.1.
E N D
chapter 2 Mathematical preliminaries • 2.1 Set, Relation and Functions • 2.2 Proof Methods • 2.3 Logarithms • 2.4 Floor and Ceiling Functions • 2.5 Factorial and Binomial Coefficients • 2.6 The Pigeonhole Principle • 2.7 Summations • 2.8 Recurrence Relations
Concept of Set 2.1 • Set: Any collection of objects, which are called members or elements of the set. • Set can be finite or infinite. • Operation of Set: • Union: • Intersection: • Difference: • Complement:
Concepts of Relations 2.1 Relation: An ordered n-tuple (a1, a2, …, an) is an ordered collection that has a1 as its first element, a2 as its second element, …, and an as its nth element. Binary Relation: Let A and B be two nonempty sets, R from A to B is a set of ordered pairs (a, b) where and , that is . Equivalence Relations: A relations R on a set A is called an equivalence relations if it is reflexive, symmetric and transitive.
2.1 Concepts of Functions • Function: a function f is a (binary) relation such that for every element there is exactly one element with • Dom(f) : the domain of f, is the set: Dom(f) = {a | for some • Ran(f) : the range of R, is the set Ran(f) = {b | for some
2.2 Proof Methods • Direct proof • Indirect proof • Proof by contradiction • Proof by counterexample • Mathematical induction
2.2 Direct Proof • Method: To prove that “P->Q”, a direct proof works by assuming that P is true and then deducing the truth of Q from the truth of P. • E.g. : To prove the assertion: If n is an even integer, then n2 is an even integer.
2.2 Indirect proof • Method: the implication “P->Q” is logically equivalent to the contrapositive implication • E.g. Consider the assertion: if n2 is an even integer, then n is an even integer.
2.2 Proof by Contradiction • Method: to prove the statement “P->Q” is true, we start by assuming that P is true but Q is false. If this assumption leads to a contradiction, it means that our assumption that “Q is false” must be wrong, and hence Q must follow from P. • E.g. to prove the assertion: there are infinitely many primes.
2.2 Proof by counterexample • Method: to provide quick evidence that a postulated statement is false. When we are faced with a problem that requires proving or disproving a given assertion, we may start by trying to disprove the assertion with a counterexample. • E.g. Let f(n)=n2+n+41 be a function defined on the set of nonnegative integers. Consider the assertion that f(n) is always a prime number.
2.2 Mathematical induction • Method: to prove that a property holds for a sequence of natural numbers n0,n0+1,n0+2,…, where n0 can be 0 or 1 or any natural number. Suppose we want to prove a property P(n) for n=n0,n0+1,n0+2,…, whose truth follows from the truth of property P(n-1) for all n>n0. First, we prove that the property holds for n0. This is called the basic step. Then, we prove that whenever the property is true for n0,n0+1,…,n-1, then it must follow that the property is true for n.This is called the induction step. We then conclude that the property holds for all values of n>=n0.
2.3 Logarithms • Let b be a positive real number greater than 1, x a real number, and suppose that for some positive real number y we have y=bx. Then, x is called the logarithm of y to the base b, and we write this as x=logby
2.3 Logarithm_some formula • logbxy=logbx+logby • Logb(cy)=ylogbc • , x,y>0
2.4 Floor and Ceiling Functions • Let x be a real number. The floor of x, denoted by ,is defined as the greatest integer less than or equal to x. The ceiling of x, denoted as , is defined as the least integer greater than or equal to x.
2.4 Floor and Ceiling Functions • Theorem 2.1 Let f(x) be a monotonically increasing function such that if f(x) is integer, then x is integer. Then,
2.5 Factorial and Binomial Coefficients_factorial • Permutation: A permutation of n distinct objects is defined to be an arrangement of the objects in a row. • is called the number of permutations of n objects taken k at a time. • is called the number of permutations of n objects.
2.5 Factorial and Binomial Coefficients_ Binomial Coefficients • is called the combinations of n objects taken k at a time, which is choose k objects out of n objects, disregarding order. • This quantity is denoted by , read “n choose k”, which is called the binomial coefficient.
2.5 Factorial and Binomial Coefficients_ Binomial Coefficients • Some equations: • in particular
2.5 Factorial and Binomial Coefficients_ Binomial Coefficients • Theorem2.2: Let n be a positive integer, Then • If let x=1, then • If let x=-1, then
2.6 The Pigeonhole Principle • Theorem 2.3 If n balls are distributed into m boxes, then (1) one box must contain at least balls, and (2) one box must contain at most balls. • E.g. Let G=(V,E) be a connected undirected graph with m vertices. Let p be a path in G that visits n>m vertices. We show that p must contain a cycle. Since >=2, there is at least one vertex to be visited by p more than once.
2.7 Summation • A sequence a1,a2,…, is defined formally as a function whose domain is the set of natural numbers. Let S=a1,a2,…,an be any sequence of numbers. The sum a1+a2+…+an can be expressed compactly using the notation: Where f(j) is a function that defines a permutation of the elements 1,2,…,n.
2.7 Summation-some formulae • If c=2, then
2.7 Summation-some formulae • If c = ½, then • If |c|<1, and the sum is infinite, then
2.7 Approximation of summation by integration • Let f(x) be a continuous function that is monotonically decreasing or increasing, and suppose we want to evaluate the summation • We can obtain upper and lower bounds by approximating the summation by integration as follows if f(x) is decreasing, then if f(x) is increasing, then
2.7 Approximation of summation by integration • E.g.1: derive an upper and lower bounds for the summation • E.g. 2: derive upper and lower bounds for the harmonic series • E.g. 3: derive upper and lower bounds for the series
2.8 Recurrence Relation • Solution of linear homogeneous recurrence • Solution of inhomogeneous recurrence • Solution of divide-and -conquer recurrence • Definition: • A recurrence relation is called linear homogeneous with constant coefficients if it is of the form • In this case, f(n) is said to be of degree k. When an additional term involving a constant or a function of n appears in the recurrence, then it is called inhomogeneous.
2.8 Linear homogeneous recurrences • Form: • Characteristic equation: • First linear homogeneous recurrence • The solution is: • Second linear homogeneous recurrence • The characteristic equation: • The solution is:
2.8 Inhomogeneous recurrences • Form: • Solution: • Form: • Solution:
2.8 Solution of divide-and-conquer recurrence • Form: • Some technique: • Substitution • Iteration • Master theory
2.8.1 Substitution • Method: To guess a solution and try to prove it by appealing to mathematical induction. • Guess method 1: using the similar known function. • E.g. To solve the function: • Note: try to guess:
2.8.1 Substitution (cont.) • Guess method 2: guess the loose upper and lower bounds, then make the bounds accurate. • E.g. To solve the function: • E.g. To solve the function:
2.8.1 Substitution (cont.) • Change of variables: By changing the variable to make the recurrence equation to be simple one. • E.g. To solve the function:
2.8.2 Iteration • Method: Expanding the recurrence, change the equation to be summation, then using the solving technique of summation. • E.g. To solve the function:
2.8.3 Master Theorem • Let a>=1 and b>1 to be constants, f(n) is a function, T(n) is a function which defined in nonnegative integer set, and with the form: T(n) can be solved as follows, (1) if is a constant, then (2) if (3) if is a constant, and for all n, is a constant, then
2.8.3 Master Theorem (cont.) Intuitively, Master Theorem can be understood as follows, Just compare the functions T(n) can be solved as follows, (1) if bigger, then (2) if (3) If with same order, then
2.8.3 Master Theorem (cont.) e.g.1: To solve the function: e.g. 2: To solve the function: e.g. 3: To solve the function: e.g. 4: To solve the function:
Master Theorem (cont.) • Theorem: Let b and d be nonnegative constants, and let n be a power of 2, then, the solution to the recurrence: f(n)=2f(n/2)+bnlogn n>=2; f(1)=d is f(n)=θ(nlog2n)