This week, we had our second midterms and also second assignment due. What a busy week! Guess I will take a break from studying this weekend... Anyways, I think I did pretty well on the test as well as on the assignment. I personally think that the assignment is harder and it took me and my partner quite long to finish it, Question 2 is alright but Question 1 really got us, especially Claims 1.3 and 1.4. Because we never did this kind of proof: for example, we knew that Claim 1.4 was wrong however when we negate the statement, we didn't know how to prove x=y. Thanks to Google, and thanks to professor that we now know that we have to prove x >= y and x <= y in order to prove they are equal.
During this week's lectures, we continued talking about Big O and Big Omega (but mainly Big O) and we started learning the actual proofs of Big O. As I've mentioned before, we have to start from definitions for most of the proofs. So, for Big O, the key point is to find an c and an B that make satisfy the definition. The Big O proof is sort of like limit proof in which you will have to work backwards to find the right number in both cases.
We've also learnt how to disprove the Big O statement, which is just proving its negation. However, the problem for me is not how to prove/disprove it but figuring out if the function satisfies the Big O or not.Therefore, I usually assume the function is Big O, and try to find an c and B that works,and if I can't, I will then disprove it. I think my technique is time-consuming,especially on a test, but I cannot find a better way to do it. If any of you know, please tell me!
Tuesday, 2 December 2014
Week 8: Intro to Big O and Big Omega
In this week's lectures,we were introduced to the notation of Big-Oh and Big-Omega, which is merely the two assessment used to test how efficient an algorithm is. As I mentioned in last week's slog, it is extremely important for an programmer/software developer to know the running time and efficiency of his algorithms.
Big O specifically describes the worst-case scenario, and can be used to describe the execution time required by an algorithm. O(N), for example, describes an algorithm whose performance grows linearly and in direct proportion to the size of the input data. O(N2), on the other hand, represents an algorithm whose performance is directly proportional to the square of the size of the input data. The more formal definition, mentioned by professor in class, for O(n^2) is that beyond a breakpoint B, f(n) is upper bounded by cn^2, where c is a constant multiplier.Big Omega, which is completely the opposite of Big O, is used to describe the best case running time for a given algorithm.
Sometimes, people also describe Big O and Big Omega as bounds: Big O represents the upper bound running time for an algorithm, which is also the “worst case” whereas Big Omega is used to represent the lower bound, which is also the “best case” for that algorithm.
Sometimes, people also describe Big O and Big Omega as bounds: Big O represents the upper bound running time for an algorithm, which is also the “worst case” whereas Big Omega is used to represent the lower bound, which is also the “best case” for that algorithm.
Week 7: Running time
This week, we wrapped up the end of proving techniques and started talking about efficiency of different algorithms. To conclude the proof part, we learnt some inferences such as conjunction/disjunction elimination, existential instantiation, etc. These rules allow us to do proofs more efficiently by reducing some redundant steps. Then we moved on to calculating the running time for different functions, which refers to the number of steps that function takes.
Running time of an algorithm is an essential part of computer science, because every programmer or software developer has to present an algorithm that's as efficient as possible. Since programmers has to deal with huge amount of data, so we don't want the algorithm produced takes forever to output the result. And to make sure that we -- as starting programmers won't run into that trouble, we will have to first learn how to count the running time of a function. In this week's lectures, we compared bubble sort and merge sort. And we input some specific numbers into the function to determine how many steps each function takes, and then conclude that which one is faster and more efficient. Then we compare the growth factor of each function, i.e. if we double the number of data of input, how will the running time of each function change? Will the ratio of the running time of two functions stay the same? And we found that some functions do better (faster) when there's big amount of data, while some functions run faster if the data is small and run slower and slower as the data gets larger and larger.
Running time of an algorithm is an essential part of computer science, because every programmer or software developer has to present an algorithm that's as efficient as possible. Since programmers has to deal with huge amount of data, so we don't want the algorithm produced takes forever to output the result. And to make sure that we -- as starting programmers won't run into that trouble, we will have to first learn how to count the running time of a function. In this week's lectures, we compared bubble sort and merge sort. And we input some specific numbers into the function to determine how many steps each function takes, and then conclude that which one is faster and more efficient. Then we compare the growth factor of each function, i.e. if we double the number of data of input, how will the running time of each function change? Will the ratio of the running time of two functions stay the same? And we found that some functions do better (faster) when there's big amount of data, while some functions run faster if the data is small and run slower and slower as the data gets larger and larger.
Week 6: Proofs and Limits
Furthering our discussion on proofs, prof taught specifically how to use different proof techniques: under what kind of conditions we should use proof by cases or direct proofs etc.
We focused on the non-boolean functions, in which we are not allowed to apply quantifiers on them. So we will have to manipulate the expression a bit in a way that quantifiers are not used to functions and at the same time, our words have to be as precise as possible compared to the original definition. We also learnt limits this week, which is a tricky one because it involves thinking backwards to find the satisfying delta that makes the proof work. But I think the formal knowledge background from Mat137 will help me a bit on this part. Besides, we also tackle the disproof, which is totally the opposite of proving. Disproving involves finding counterexample which falsifies the statement, or we can negate the statement first and prove the negation.
We focused on the non-boolean functions, in which we are not allowed to apply quantifiers on them. So we will have to manipulate the expression a bit in a way that quantifiers are not used to functions and at the same time, our words have to be as precise as possible compared to the original definition. We also learnt limits this week, which is a tricky one because it involves thinking backwards to find the satisfying delta that makes the proof work. But I think the formal knowledge background from Mat137 will help me a bit on this part. Besides, we also tackle the disproof, which is totally the opposite of proving. Disproving involves finding counterexample which falsifies the statement, or we can negate the statement first and prove the negation.
Week 5: Proofs and Limits
We had our first test for this course during this week. I don't know what I should say about this test because it's not hard but one of the question (last one) I wasn't expect that to be on the midterm... So I think I didn't do as good as I expected, but it is not so bad. Guess I REALLY need to work on that type of question now: I didn't do it well on the assignment, and I screwed it up on the test. Ah, this is frustrating...
Getting back to the topic of this week's material, so basically we are continuing the topic of proof this week. We learnt how to prove ∃ and Ɐ: we only need to find one thing that satisfies the statement in order to prove the "there exists" quantifier, and we need to assume some generic numbers for the "for all" quantifier. Also, we learnt some different ways of proofs: direct proof, proof by contradiction and proof by cases. In addition, we now know the importance of a definition to one proof: we will most likely have to use the definition given to prove the statement and there's no other way to do it.
Getting back to the topic of this week's material, so basically we are continuing the topic of proof this week. We learnt how to prove ∃ and Ɐ: we only need to find one thing that satisfies the statement in order to prove the "there exists" quantifier, and we need to assume some generic numbers for the "for all" quantifier. Also, we learnt some different ways of proofs: direct proof, proof by contradiction and proof by cases. In addition, we now know the importance of a definition to one proof: we will most likely have to use the definition given to prove the statement and there's no other way to do it.
Monday, 1 December 2014
Week 4: Intro to Proofs
This week, we are starting to get a sense of proofs, which I believe is the main topic of this course.
We are just introduced to the structure pf the proof:
Introduce quantifiers, pick something for ∃ quantifier, then make use of transitivity of implications (in which P implies Q, and Q implies R is equivalent of saying P implies R) to prove the final statement which is usually an implication. These are all the easy parts, and the prof hasn't taught us the hard part which is how to figure a way to prove the final statement. Playing with those notations and finding a number that satisfying the condition that we need to prove is not my strong part, so I think I need to do some preview if I wanna do good on proofs.
In addition, our first midterm is coming up next week. I feel fortunate that we won't be tested on the proof stuff. However, I am still kind of nervous for this coming test since I did not start right from the beginning like others (see my first slog) and I feel that there's some kind of gap between the material I learnt later on in this course and the material that I learn by myself which is just the one that I've missed. But anyway good luck to myself.
We are just introduced to the structure pf the proof:
Introduce quantifiers, pick something for ∃ quantifier, then make use of transitivity of implications (in which P implies Q, and Q implies R is equivalent of saying P implies R) to prove the final statement which is usually an implication. These are all the easy parts, and the prof hasn't taught us the hard part which is how to figure a way to prove the final statement. Playing with those notations and finding a number that satisfying the condition that we need to prove is not my strong part, so I think I need to do some preview if I wanna do good on proofs.
In addition, our first midterm is coming up next week. I feel fortunate that we won't be tested on the proof stuff. However, I am still kind of nervous for this coming test since I did not start right from the beginning like others (see my first slog) and I feel that there's some kind of gap between the material I learnt later on in this course and the material that I learn by myself which is just the one that I've missed. But anyway good luck to myself.
Week 3: Implications
This week, we went deeper into the notations introduced from last two weeks. We've learnt implication, conjunction,disjunction, negation, tabulation, De Morgan's Law and some properties of logic operation such as associativity etc. This week's material is starting to be new now as I've never touched it before. But it is not that challenging as well, so I guess I won't be talking about it in detail.
Right now I am mainly focusing on the assignment that's due at the end of next week. It is quite consuming though it seems pretty easy at the first glance ( and luckily I've got a partner!). Questions 4 and 5 confuse me the most, even now I am writing this Slog, trying to take a break from finishing the last part of the assignment, I still cannot get it. For question 4, I personally think that there are many answers depending on the examples you are taking. If you take D, P and Q to be some numbers that are divisible to 2 or to 3, the answer will be different from the one if you take D, P and Q as the numbers of girls and guys in one school that are able to play piano and baseball. I might be (and probably am) wrong, but I just couldn't figure out the right answer. Guess I will just ask Prof Heap for help during his office hour then.
Right now I am mainly focusing on the assignment that's due at the end of next week. It is quite consuming though it seems pretty easy at the first glance ( and luckily I've got a partner!). Questions 4 and 5 confuse me the most, even now I am writing this Slog, trying to take a break from finishing the last part of the assignment, I still cannot get it. For question 4, I personally think that there are many answers depending on the examples you are taking. If you take D, P and Q to be some numbers that are divisible to 2 or to 3, the answer will be different from the one if you take D, P and Q as the numbers of girls and guys in one school that are able to play piano and baseball. I might be (and probably am) wrong, but I just couldn't figure out the right answer. Guess I will just ask Prof Heap for help during his office hour then.
Subscribe to:
Posts (Atom)