Wednesday, 19 November 2014

Nifty Trick to Prove f(n)∉cn^2

Let's use this as an example to show this little nifty trick (Not really a trick but I thought it was interesting)

                     6n5-4n3+2n ∉ O(5n4-3n2+1)

Now, normally, people would try to prove this is a normal way by converting the 6n5-4n3+2n ∉ O(5n4-3n2+1) into it's definition form then proving the statement. That is totally fine and it is not a wrong method to prove the statement.

The nifty trick that I learned from my tutorial is to switch the sides of the polynomials and prove that 5n4-3n2+1 ∈ O(6n5-4n3+2n), because if 6n5-4n3+2n is not upper bounded by 5n4-3n2+1 then that means 6n5-4n3+2n grows faster than 5n4-3n2+1. Therefore, that means 5n4-3n2+1 is upper bounded by 6n5-4n3+2n.


∃c∈R2, ∃B∈N, such that ∀n∈N, n≥B → f(n)≤cn2
           Pick c=1/3, then c∈R2
Pick B=1, then B∈N
                     Assume n∈N
                                         Assume n≥1
                                                             Then, 6n5-4n3+2n ≥ 6n5-4n3
                                                                                              ≥ 6n5-4n5
                                                                                              ≥ 2n5
                                                                        2n5 ≥ (1/3)(6n4)    # n≥1                                                                                 ≥ (1/3)(5n4+n4)
                                                                                ≥ (1/3)(5n4+1)
                                                                                ≥ (1/3)(5n4-3n2+1)
                                                              Then, 6n5-4n3+2n ≥ c(5n4-3n2+1)
                      Then, ∀n∈N, n≥B → 6n5-4n3+2n ≥ c(5n4-3n2+1)
 Then, ∃c∈R2, ∃B∈N, such that ∀n∈N, n≥B → f(n)≤cn2
Then, 5n4-3n2+1 ∈ O(6n5-4n3+2n)
Then, 6n5-4n3+2n ∉ O(5n4-3n2+1)

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hello Justin,

    Correct me if I am wrong, but the only way to prove 6n5-4n3+2n ∉ O(5n4-3n2+1) is to prove that its negation is true. There could be a case in which neither 6n5-4n3+2n is in Big-Oh of 5n4-3n2+1 nor 5n4-3n2+1 is in Big-Oh of 6n5-4n3+2n.If you have a look at assignment 3, you may understand my point.

    All the best,
    Christian

    ReplyDelete