What would the Big oh be of (1/2)^n

31 Views Asked by At

Is it just (1/2)^n?

The function itself gets closer and closer to 0 as x > infinity but I don't know what its classification would be in terms of big oh. O(1)?

1

There are 1 best solutions below

0
On

Yes. Your function is $O(f)$ for any function $f$ that satisfies $k|f(n)| \geq 2^{-n}$ for all $x \geq m$, for some $k$ and $m$. $f(n)=1$ works fine, with $k = 1$ and $m=0$.

Note though that there is no such thing as "the big O" of a function. For any $g(n)$, even for those less unusual than $2^{-n}$, there are many, many valid function $f(n)$ such that $g = O(f).$