Search⌘ K

Some Useful Facts

Explore fundamental mathematical facts that support algorithm analysis including growth rates of functions, validations of big-O notation for integers, and properties of logarithms. This lesson helps you understand how standard growth relationships simplify complexity discussions and prepare you to analyze running times accurately.

Some handy results

In this lesson, we discuss four results that are useful to know. Note that the size of input for an algorithm is always some discrete value. That’s the reason these results are proven here for integer values of nn only and not real values of nn.

Fact I: n is O(2n){n \text{ is } O(2^n)}.

In fact, 2n2^n is a strict upper bound on nn, for any integer nn.

n<2n   for all n1n \lt 2^n\ \ \text{ for all }n \geq 1

It’s clearly true for n=1n=1, but it’s also true for larger values as for every unit increase in the value of nn, the left-hand side (LHS) increases by 11, but the right-hand side (RHS) doubles.

Here’s another well-known fact.

Fact II:  log2n is O(n)\ \log_2 n \text{ is } O(n).

Once again, we can say something stronger:

log2n<n    for all n1\log_2 n < n\ \ \ \text{ for all }n \geq 1 ...