This week, we we talked about the formal definition of O and Ω, and we learned how to prove a function is in O. The definition for O is that ∃c∈ℝ+,∃b∈ℕ,∀n∈ℕ,n≥b => f(n) ≤ cg(n). This definition means that after a break point "b", f is always smaller than g. Conversely, Ω means that after the break point "b", f is always bigger than Ω. Therefore the definition of Ω is that ∃c∈ℝ+,∃b∈ℕ,∀n∈ℕ,n≥b => f(n) ≥ cg(n).
To prove a function is in O, we need to find a suitable c such that f(n) ≤ cg(n). For example, in class we talked about how to prove the worst case complexity of insertion sort is in O(n^2). To solve this question, we can pick n = 10 then Wis = (3/2)n^2 + (9/2)n - 4 ≤ 10n^2. Next, we pick a b ≤ 10. Therefore, we proved that Wis is in O.
2014年10月31日星期五
2014年10月24日星期五
WEEK 7 JOURNAL: THE PROVE STRUCTURE
This week, we became more familiar with the proof structure and we learned about how to make the statement precise and short. In programming, every statement must be precise, otherwise the program won't work. However, some programs are precise but because the program is too long, the working procedure will take lots of time. Thus, we should make our statement short and precise. In order to do this, we need to find and delete the sufficient but not necessary condition in our statement.
2014年10月17日星期五
WEEK 6 JOURNAL: PROVE BY CASES
This week, I learned how to prove a statement by cases. We can divide a statement into several situations, and show that for every situation, this statement is always true. Then, the statement is true. I find using this method can make some problems be easier to solve, because we only need to proof each part of a statement is true, and then the whole statement becomes true. However, the drawback of this method is that when we proof by cases, we must cover all the cases, otherwise the proof won't make sense. For now we have learned several methods to proof a statement is true or false. In some proofs, we need to use several methods to prove, and I think that's the hard point. Because in the sample problems, we only prove each statement by using one single method, and when we need to prove a statement by using several methods, I think it is hard to choose which method I should use and which I should not use.
2014年10月3日星期五
WEEK 4 JOURNAL: IMPLICATION, DISJUNCTION AND PROOF
This week we first talked about the bi-implication and its negation. Bi-implication can be written as A <=> B. This is equivalent to (A => B) ∧ (B => A) or we can write this as (¬A ∨ B) ∧ ( ¬B ∨ A). The negation for bi-implication is (A ∧ ¬B) ∨ (B ∧ ¬A).
Then we talked about some thing about how to prove a universally-quantified implication is true. If we want to prove A => B, the key to prove this implication is that we need to find the relationship between A and B, in other words, there must be some common traits between A and B. We can use Venn diagram and truth table to help us find the common traits between A and B, and then we can judge which statement is true. For example, if we find that A ⊆ B on Venn diagram, we can say that A => B.
When doing assignment 1, I find it is hard to judge when to use the imply symbol and when to use and. Because according to the truth table, "∧" and "=>" are always the same except vacuous truth. In addition, use vacuous truth is a quicker way to find examples or counter-examples.
Then we talked about some thing about how to prove a universally-quantified implication is true. If we want to prove A => B, the key to prove this implication is that we need to find the relationship between A and B, in other words, there must be some common traits between A and B. We can use Venn diagram and truth table to help us find the common traits between A and B, and then we can judge which statement is true. For example, if we find that A ⊆ B on Venn diagram, we can say that A => B.
When doing assignment 1, I find it is hard to judge when to use the imply symbol and when to use and. Because according to the truth table, "∧" and "=>" are always the same except vacuous truth. In addition, use vacuous truth is a quicker way to find examples or counter-examples.
订阅:
博文 (Atom)