In which class of Big O does the function (1/2) ^ n fall into?
On a purely mathematical basis, it seems that we would have to put it in O (1), because 1/2 ^ n approaches 0 for any sufficiently large n.
However, when it comes to asymptotic analysis and Big O, we tend to wave our arms a lot and also refer to formulas. 1/2 is technically constant, so it would seem to fall into O (c ^ n).
I lean toward O (c ^ n) because "half the operation" doesn't make sense when it comes to algorithms. Which algorithm takes half time as input increases? In the best case, I see the mathematical formula (1/2) ^ n, related to half of some constant time - say, a minute. So (30 seconds) ^ n becomes a huge number, and the function clearly belongs to O (c ^ n).
Help a little?
source
share