HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Does it make sense to say Big Theta of 1? Or should we just use Big O?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
thetajustsaymakebigsensedoesshoulduse

Problem

Does saying $f(x) = \Theta(1)$ provide any extra information over saying $f(x) = O(1)$?

Intuitively, nothing grows more slowly than a constant, so there should be no extra information in specifying Big Theta over Big O in this case.

Solution

Remember your definitions! As $n \to \infty$ (the use in CS, almost always) $O(\cdot)$ is an upper bound (within a constant multiple, for large $n$), $\Omega(\cdot)$ is a lower bound (within a constant multiple, for large $n$), and $\Theta(\cdot)$ both of the previous. To see the difference, as $n \to \infty$ you have:

$\begin{align*}
1 + \lvert \sin n \rvert
&= O(1) \\
1 + \lvert \sin n \rvert
&= \Omega(1) \\
1 + \lvert \sin n \rvert
&= \Theta(1) \\
e^{-n}
&= O(1) \\
e^{-n}
&\ne \Omega(1) \\
e^{-n}
&\ne \Theta(1)
\end{align*}$

For the first three, as $\sin x$ moves between -1 and 1, the expression fluctuates between 1 and 2.

To see why $e^{-n} \ne \Omega(1)$ (and so $e^{-n} \ne \Theta(1)$), note that we are looking for a constant $c > 0$ and an $N_0$ so that for all $n \ge N_0$ we have $e^{-n} \ge c \cdot 1$. For any $c$ you pick, you'll find that taking $n > \ln 1 / c$ makes this false. So no $c$ works.

Context

StackExchange Computer Science Q#123300, answer score: 16

Revisions (0)

No revisions yet.