Wednesday, 12 November 2014

csc165 week9 SLOG:
    In this week's lecture, we continued learning of the big-O proofs. We learnt from week8's lecture that the formal definition of big-O. For example, the formal definition of  O(n^3 + 2n + 1) is that
{f : N -> R(>=0) | ∃c∈R+,∃B∈N,∀n∈N, n>=B=> f(n) <= c(n^3+ 2n + 1)}.
    To prove 5n^2 + 5n + 1 ∈ O(n^3 + 2n + 1), we should first consider whether this claim is right. If it is wrong we should disprove it by negating the original claim. In this case, the claim is correct. My first thought of proving this claim is to try to let n >= 1, then n * n >=  n. And I can let n >= 1 by picking a B = 1 while 1 is a natural number. Then I want to compare two functions by comparing their highest-order term. Since n>=1,5n^2 + 5n + 1 <= 5n^2 + 5n*n + 1*n^2 = 11n^2. And then I can choose c equals to the positive real number 11 such that O(n^3 + 2n + 1) = 11(n^3 + 2n + 1) =  11n^3 + 22n + 11 >= 11n^3, since n and 11 are both positive number. Then we can get 11n^3 = 11n * n^2 >= 11n^2 since n >=1,then 5n^2 + 5n + 1 <= 11(n^3 + 2n + 1). Finally we can get 5n^2 + 5n + 1 ∈ O(n^3 + 2n + 1) from above.
     And if a claim of Big-O is wrong,we should disprove it. For example, n^4 ∈O(n^3), in order to disprove it, I need to prove the negation of this claim. The original claim can be written as ∃c∈R+,∃B∈N,∀n∈N, n>=B=>  n^4 <= c(n^3). Then the negation of this claim is ∀c∈R+,∀B∈N,∃n∈N, n>=B ∧  n^4 + 1 > c(n^3). And the main part of proving this is to pick a wise n, in this case I  pick n = c + B +1 to make n > c and n > B in order to let n*n^3 > c*n^3 ∧ n>=B for all n∈R+and all B∈N. 
    We also learnt about proving Big-O by using limit. For example,3^n ∈ n^3, since 3^n is non-polynomial, we can use limit. And we can find the ratio of 3^n/n^3 approaches infinity while n gets larger and larger by L'Hopital's rule. And the definition of this limit is ∀c∈R+,∃n'∈N,∀n∈N, n>=n'=> 3^n/n^3 > c. Finally,more about proof of this limit will be more detailedly taught in next week.
    
 

No comments:

Post a Comment