0
$\begingroup$

What would these statements mean if f(n) and g(n) are functions over natural numbers?

g(n) is in Θ(f(n)). and

An algorithm is in the complexity class Θ(f(n)).

Raphael
73.3k31 gold badges183 silver badges403 bronze badges
asked Aug 22, 2018 at 9:33
$\endgroup$
2
  • $\begingroup$ You are asking for the definition, which can be found in any resource. If you want some intuition, there's an older question with good answers. $\endgroup$ Commented Aug 22, 2018 at 9:56
  • 1
    $\begingroup$ "An algorithm is in the complexity class Θ(f(n))." -- that's not something we would say because it doesn't type check. 1) $\Theta(f)$ is not a complexity class (which is a set of problems), it's a class of functions. 2) Algorithms are contained in neither. $\endgroup$ Commented Aug 22, 2018 at 9:58

1 Answer 1

1
$\begingroup$

$g(n)$ is in $O(f(n))$ means that there exists a positive number $c$ such that $g(n) \leq c \cdot f(n)$ for all $n$ (or at least all large $n$s). In other words, $g(n)$ does not grow faster than $cf(n)$.

We say "is in" because $O(f(n))$ is a class of all functions that satisfy above condition. It is also sometimes said just "is" and written $g(n) = O(f(n))$ but in my opinion this is too misleading because equality here is not symmetric.

That an algorithm is in a complexity class $O(f(n))$ means that a function $g$ that measures the number of basic calculation steps (dependant of the input size $n$) of this algorithm is in $O(f(n))$.

Useful links:

answered Aug 22, 2018 at 9:40
$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.