tags:

views:

45

answers:

1

Hello.

I am reading thee book "Discrete Mathematics and its Application" by Kenneth H. Rosen I am now in the chapter Growth of Functions and trying the Exercise of that.[5th Edition page 142]

I am stuck here:

Determine whether these functions are in O(x^2) [(big oh of x's square]

[1] f(x) = 2^x,

[2] f(x) = (x^4)/2

[3] f(x) = floor(x) * floor(x)

I can not do the 1st one. Will anybody please help?

I have done the 2nd and 3rd as follows. Please check and comment.

[2]

if f(x) = (x^4)/2 is O(x^2) for x > k (k = any constant, C = any constant)

___then |(x^4)/2| <= C|.(x^2)| for x > k

___or |(x^2)| <= 2C for x > k

___or x <= sqrt(2C) for x > k

___or x<= C1 [ C1 = sqrt(2c) = Constant]

___but this contradicts with x > k where k is any constant

so f(x) is not O(x^2)

[3]

 f(x) = floor(x) * floor(x) <= x * x for x > 1
__or f(x) <= x^2 for x>1
__so f(x) is O(x^2) taking C = 1 and k = 1 as witness

Please help me in the 1st one.

A: 

f(x) is in O(g(x)) exactly when f(x) <= a*g(x)+b for large x and fixed a and b. One method from elementary calculus is to divide and take the limit:

lim(f(x)/g(x)) as x->inf

If this is zero, then f(x) grows strictly slower than x^2. If it's any other finite number, then the two functions are in the same big-O class (and that number is your C-witness). If it's infinity, then f(x) is NOT O(x^2).

The simpler approach is just to look at the largest power of x (for polynomials) or just know that k^x grows faster than x^k for all fixed k greater than one. (Hint: this is your answer.)

Big-O notation is something you should be able to eyeball. In fact, if you aren't presently this comfortable with the relations between algebraic functions, then you're better off to drop the algorithms class and switch to a math class first until you have good grades in calculus. Then, you will have no trouble at all with big-O notation.

Ian