0

Hi I am faced with a problem of proving that a function is an element of big theta. The question reads as follows: is 4n^3+23n^2+1 (is an element of) Theta(n^3), and prove your answer. My answer is as follows: ans Basically I am proving it is in both in big oh and big omega and if so it is in big theta. Is this correct? Also, what is the best way of proving that a given function is in big theta using limits?

amine
  • 53
  • 1
  • 10
  • Be aware that the second limit is `1/4`, not infinity. In fact, it is the reciprocal of the first limit (which is `4` as you put it.) – Leandro Caniglia Nov 18 '16 at 22:38

2 Answers2

1

In order to show that f(n) = 4n^3 + 23n^2 - 1 belongs in Theta(n^3), you have to bound it between k1.n^3 and k2.n^3for some positive constants k1 and k2 when n is sufficiently large (meaning, n >= n0 for some constant n0)

Let's see this without and with limits.

Without limits

Given that

1 < 23n^2

for all n >= 1, we get

0 < 23n^2 - 1

and therefore

4n^3 = 4n^3 + 0
     < 4n^3 + 23n^2 - 1

Hence, you can take k1 = 4.

Now for the upper bound.

4n^3 + 23n^2 - 1 < 4n^3 + 23n^2
                 < 23n^3 + 23n^2
                 <= 23n^3 + 23n^3
                 = 46n^3

and you can take k2 = 46 and n0 = 1.


With limits

lim f(n)/n^3 = lim 4 + 23/n - 1/n^3 = 4

Therefore, given epsilon > 0 there exists n0 such that

| f(n)/n^3 - 4 | < epsilon

for n >= n0. Take epsilon = 1. We get

-1 < f(n)/n^3 - 4 < 1

or

3 < f(n)/n^3 < 5

or

3n^3 < f(n) < 5n^3

and you can take k1=3, k2=5 and the value of n0 that exists for epsilon = 1.

Leandro Caniglia
  • 14,495
  • 4
  • 29
  • 51
0

In the computation of Big-Omega you need to find the limit of your function divided by n3 (that's the opposite of what you did). Since it equals to 4 (which is obviously less than infinity), your function belongs to Omega(n3).

SomeWittyUsername
  • 18,025
  • 3
  • 42
  • 85
  • if I divide by n^3, won't it be proving its in big Oh and not Omega? – amine Nov 12 '16 at 18:37
  • For big-O you actually need a limit around a real number rather than infinity. Anyway, big-O is usually proved differently: there is n0 so that for each n>n0: 4n^3+23n^2-1 < 4n^3+23n^3 = 27n^3 = O(n^3) – SomeWittyUsername Nov 12 '16 at 18:51