chapter 2 Mathematical preliminaries

Post on 21-Jan-2016

58 views 0 download

description

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. - PowerPoint PPT Presentation

Transcript of chapter 2 Mathematical preliminaries

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

• 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:

BA

BA

BA

A

2.1 Concept of Set

2.1 Concepts of Relations

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.

BAR Aa Bb

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.1

)( fDomx

)( fRany fyx ),(

}),(, fbaBb

}),(, fbaAa

2.2 Proof Methods

• Direct proof

• Indirect proof

• Proof by contradiction

• Proof by counterexample

• Mathematical induction

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

"" PQ

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.2

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.3

dtt

xx

1

1ln

xy bb yx loglog

Floor and Ceiling Functions

2.4

x

x

xx

xx

xxx

2/2/

• 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.

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.4

)()(

)()(

xfxf

xfxf

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

)1)...(1( knnnPnk

nPnn ...21

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

nkC

0,)!(!

!

!

)1()...,1(

!

kn

knk

n

k

knnn

k

PC

nkn

k

k

n

Factorial and Binomial Coefficients_ Binomial Coefficients

• Some equations:•

• in particular

2.5

kn

n

k

n

10

n

n

n

1

11

k

n

k

n

k

n

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.5

n

j

jn xj

nx

0

)1(

n

n

nnn2...

10

n

oddj

n

evenj j

n

j

n

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.6

mn /

mn /

mn /

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

nj

jf

n

jjf aora

1)(

1)(

Summation-some formulae•

• If c=2, then

2.7

)(2

)1( 2

1

nnn

jn

j

)(6

)12)(1( 3

1

2 nnnn

jn

j

1,)(1

11

0

cc

c

cc n

nn

j

j

)2(122 1

0

nnn

j

j

Summation-some formulae• If c = ½, then

• If |c|<1, and the sum is infinite, then

2.7

)1(22

12

2

1

0

n

n

jj

)1(1

1

0

cc

j

j

1,)()1( 2

112

10

cnc

c

ccncncjcjc n

nnnn

j

jn

j

j

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

n

j

jf1

)(

n

m

n

mj

n

mdxxfjfdxxf

1

1)()()(

1

1)()()(

n

m

n

mj

n

mdxxfjfdxxf

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.7

.1,1

kjn

j

k

n

jn j

H1

1

n

j

j1

log

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()1()( 21 knfanfanfanf k

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

).(...)2()1()( 21 knfanfanfanf k

0...22

11

kxkk axaxax

)1()( nafnf

)0()( fanf n

0212 axax

212211 ,)( rrifrcrcnf nn

rrrifnrcrcnf nn 2121)(

Inhomogeneous recurrences• Form:

• Solution:

• Form:

• Solution:

2.8

1,)()1()( nngnfnf

n

i

igfnf1

)()0()(

)()1()()( nhnfngnf

.1,))1()...1()(

)()0()(1()...1()()(

1

ngigig

ihfgngngnf

n

i

Solution of divide-and-conquer recurrence

• Form:

• Some technique:– Substitution– Iteration– Master theory

2.8

02211

0

)()/(...)/()/()(

nnifngcnfacnfacnfa

nnifdnf

pp

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

.1)0(,)2/(2)( TnnTnT

)log()( nnnT

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

1)1(,)2/(2)( TnnTnT

1)2/()2/()( nTnTnT

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.1

1)1(,log)(2)( TnnTnT

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.2

)4/(3)( nTnnT

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

)()/()( nfbnaTnT

0,)()( log abnnf )()( log abnnT

)log()()()( loglog nnnTthennnf aa bb

0,)()( log abnnf

1,)()/( cncfbnaf

)).(()( nfnT

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

abnlog )()( log abnnT ))(()()( nfnTthenbiggernf

abnandnf log)(

abnandnf log)(

)log)(()log()( log nnfnnnT ab

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:

2.8.3

nnTnT )3/(9)(

1)3/2()( nTnT

nnnTnT log)4/(3)(

nnnTnT log)2/(2)(

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)