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

What does $n^{O(1)}$ mean?

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

Problem

I read an example that said explain what "$f(n)$ is $n^{O(1)}$" means.

I can't interpret the $n^{O(1)}$ syntax. I know what Big $O$ notation is, its just that this example looks odd to me.

Solution

It's short-hand for "$n^{f(n)}$ for some function $f(n)\in O(1)$". In other words, the function is at most $n^c$ for some constant $c$.

You can see this by directly substituting the definition of $O(1)$ in the expression. $g(n)=n^{O(1)}$ if there's constant $c$ such that, for all large enough $n$, $f(n)\leq n^{c\cdot 1} = n^c$.

This includes all polynomially-bounded functions. For example, for $n>0$,
$$n^2+3n = n^2(1+\tfrac3n) = n^{2+\log(1+3/n)/\log n} = n^{O(1)}\,,$$
since, for $n\geq 3$, we have $11$, so the exponent is between $2+\log 2$ and $2$.

Context

StackExchange Computer Science Q#79984, answer score: 8

Revisions (0)

No revisions yet.