Notational Sloppiness

  1. (λ n . n + 15) ∈ O(λ n . n2)
  2. (λ n . n + 15) ∈ O(n2)
  3. n + 15 ∈ O(n2)
  4. n + 15 is O(n2)
  5. n + 15 = O(n2)

People often get sloppy with big-O and related notations.

As we have seen, O(f) is defined only when f is a function from some set X to the real numbers. Furthermore, O(f) is a set of functions that have the same domain X as f.

Strictly speaking, only the first example above is entirely correct.

In the second example, n2 is an expression, not a function. Historically, expressions have been used interchangeably with functions because few people have known about lambda calculus.

The third example is similar, with two expressions being used where functions are necessary.

The fourth example shows a notational convention that's often used because it gets around having to use the symbol for set membership.

The fifth example is just plain wrong, really, but you'll see it being used all over the place. Just remember that all five of the examples are intended to mean what the first example expresses in correct mathematical notation.

For debugging: Click here to validate.