This week we introduce the big-Oh of polynomials. First, we introduce what is big-Oh O(n^2)? It is a polynomial function that take a natural number and return a positive real number such that

c

R+,

B

N,


N, n>=B, 3n^2+2n<=c(n^2). This may look hard to understand, so we can give a simple example of big-Oh proof.
Prove 3n^2+2n

O(n^2)

c

R+,

B

N,

n

N, n>=B, 3n^2+2n<=c(n^2)
Pick c=5 ,then C

R+
pick b=0, then B

N
assume n

N,
assume n>=B
then 3n^2+2n<= 3n^2+2n^2
=5n^2
=cn^2
then n>=B
⇒ 3n^2+2n<=cn^2
then

B

N, then n>=B
⇒ 3n^2+2n<=cn^2
then

c

R+,

B

N,

n

N, n>=B, 3n^2+2n<=c(n^2)
No comments:
Post a Comment