Thursday, 13 November 2014

General Big-O Kappa

Time to prove some general statements about Big-O, because why not. It's interesting and fun!

The most important definition that is needed to prove general statments about Big-O is F
        F : { f : N → R≥0 }
This definition is basically stating that the F is the set of all functions that takes a natural number as input returns a non-negative real number.

For example, let's prove this statement:
∀ f,g,h ∈ F, ( f ∈ O(g) ∧ g ∈ O(h) ) ⇒ f ∈ O(h)
The statement in english is basically stating that f is upper bounded by g which means it grows no faster than g and g is upper bounded by h which means it grows no faster than h. Then, f must be upper bounded by h meaning it must grow no faster than h.

Now there are a few things to think about. This means that there is a breaking point(B) and a constant factor (c) so that f grows no faster than g. At the same time there is another breaking point (B') and a second constant factor (c') so that g grows no faster than h. Now, this means we want to find a third breaking point (B'') and a third constant factor (c'') so that f grows no faster than h beyound B''.
B'' should be at a point where it is beyond both B & B'. ∴ B''=max(B,B')
To choose c'', f ≤ cg ≤ c(c'h), therefore f ≤ cc'h. ∴ c'' = c'

from here on, it's all smooth sailing on prooving this statement since we have found the perfect B'' and c'' that makes f grow no faster than h. Just assume and pick antecedents, prove that f(n) ≤ c''h(n), and finally unwrap the antecedents and voila! :)

No comments:

Post a Comment