0

I have read the definition of big O in the introduction to algorithm which book doesn't talk about my confusion.

According to its definition, everybody knows the function T(n) = 3n belongs to O(n),my confusion is whether all functions what belongs to O(n) belongs to O(n^2) and O(n^3) and O(n^4) and O(n^k) k>1, because the big O describes the upper limit,and I aways can find the positive integer constant c and positive integer constant n0 to meet 0<=3n<=cn^2 when n>=n0, if the answer is YES, why do people prefer th use O(n) to describe T(n) = 3n if its definition is serious?

More, where are these notations(big O, big theta, big omega) been used in other math field?

Please post the necessary references or any other books which talk about this

Dr.Shiki
  • 3
  • 4
  • I think I have found the answer-**for definition, big O describes either tight upper or untight upper bound. while in normal big O was only used to describe tight upper bound by people in most casees** – Dr.Shiki May 26 '16 at 12:16

2 Answers2

3

A partial answer: your understanding is correct, O(n) is a strict subset of O(n^k) for k > 1.

Why do we prefer O(n): If you ask for the price of some product (that actually costs 25) which answer would you prefer: a) at most 100 or b) at most 30. Saying that f(n) is in O(n) gives more information about f(n) than saying it is in O(n^2).

Where else is it used? For example to describe the error term of an approximation.

Henry
  • 42,982
  • 7
  • 68
  • 84
0

f(n)=O(g(n)) indeed expresses that g(n) is an upper bound to f(n) in the asymptotic sense, and any function h(n)≥g(n) is also an upper bound, f(n)=O(h(n)).

For example f(n)=O(n) => f(n)=O(n²).

But obviously, an upper bound that more closely models the target function is more interesting, and is said to be tight. So among the possible upper bounds, one chooses the tightest bound, when it is known.

For some functions, it may arise that the same g(n) is also a lower bound (with a different asymptotic constant), what we denote as f(n)=Ω(g(n)). In such a case, the bound is tight both ways, and one writes f(n)=Θ(g(n)).

And of course, 3n=Θ(n), but 3n<>Θ(n²).