Sunday, 30 November 2014

Week 12

This past week, we learned some very interesting proof techniques. Rather than going to Professor Danny's lectures, I want to the Tuesday night lecture instead (due to work conflicts) so this blog is based on on Larry's lecture. One very interesting proof technique we learned is called simple induction. The idea of this is to test a base case of a theorem. Then we assume P(n) is true, where P(n) is a predicate true for some n and we test to see if P(n) implies P(n+1).

The idea of induction is similar to that of falling dominoes. If we tip over domino 1 in a line of dominoes, then we know domino 1 falls. We also know domino 2 falls since domino 1 knocks it over, and so on. So if we assume domino n falls, then domino n+1 also falls because domino n hits domino n+1. We use this idea to prove many theorems. I find induction to be a very useful method because it helps to prove many theorems that are very difficult to prove using direct proof. One such example is: 
3n-1 is a multiple of 2 for all integers n.
First we test the base case: P(1) = 3-1 = 2 which is a multiple of 2.
Then we assume P(n). We must show P(n+1) is true.
Then 3n+1-1 = 3*3n -1 = (2*3n) + (3n-1)
(2*3n) is divisible by 2 since when divided by two, the expression results of an integer 3n, and (3n-1) by our inductive hypothesis. So P(n) implies P(n+1) and our statement is true.
This is an example of how using induction can substitute a direct proof, since it can be very difficult to derive the statement above.

I found it nice that the professor used the domino analogy to explain the concept of induction to us, because without it, it would be difficult to understand why induction works and the theory behind induction. It was also nice to see the professor give us some examples in class and walk us through it step by step, as it that gave us an opportunity to solve problems with him, giving us the ability to try some problems at home involving simple induction. I found the concept of induction simple enough to follow, and I did a few problems at home. It was very beneficial to go to office hours and have some of my practice work corrected.

In order to improve my skills on induction, I think that it will be beneficial to continue finding some basic problems on the internet and solving them on my own to get practice. Although induction is not a concept that we are required to master for the final exam, I believe that working on some proof problems using induction and learning strong induction will be beneficial for the final exam, because there will be some problems in the final exam that will be easier to solve using induction as per the professor. Therefore, by practicing induction, I will be improving my skills in proving theorems and I may benefit by solving some problems on the final exam more quickly. I can also improve my skills on induction by referring to a calculus book and reading the section on induction, as it may go more into depth on the topic of induction and give me some interesting problems to work on that haven't been presented in this course.

I feel as though my experience is similar to that of the blogger (http://yuejiang165.blogspot.ca/) in her final blog entry. I too had a difficulty proving the first question on A3 not because it was something I couldn't solve, but mainly because I had to prove that abs(x+y) ≥ abs(x-y), and I did not know how to fit that aspect within my proof. In other words, I struggled with the structure of the proof for this question. I also agree with the blogger (http://arvindrameshslog165.blogspot.ca/) in his last paragraph of his final blog entry which states that he finds the concepts of induction not too easy and not too hard. Similar to him, I also found the material very simple once I went to office hours and worked on some problems. I am glad to see that my peers are enthusiastic and are working hard, and that my experience and thoughts are very similar to these bloggers.

It is time for me to get ready for the final exam, and I will need to utilize the office hours of the professor and the information in the course notes for review!

Tuesday, 25 November 2014

Problem Solving Section

Problem Solving Section
I found this problem that was challenging and relevant to the topic of induction introduced:

Use Mathematical Induction to prove that if S is a non-empty set of positive integers, then S has a smallest element (also known as the Well Ordering Property)

Understand the Problem

Polya mentions that the first step of solving any problem is reading the question, presumably carefully. By reading the problem, I know that I must use induction in my proof of the Well Ordering Property. This means that I must have a base case, assume P(n) and prove P(n+1). If I am able to do that successfully, I will have solved the problem.

Make a Plan

One way I thought of proceeding is by doing a proof by contradiction using induction. This seems like the most direct way of proceeding. I can assume that S does not have a smallest element and is non-empty, but if the base case is in the set S (the base case being 1), then 1 must be the smallest element. This leads to a contradiction. I can proceed with my proof using induction using this idea.

Carry Out the Plan

Let A = {n∈ \mathbb{N}| n is not an element of S}. Assume that S is not empty and that it does not have a least element.
Let P(n) : n∈A.
We know that 1 is not an element of S because if 1 was an element of S, then it would be the smallest element in S as it is the smallest element in \mathbb{N}. In this case, we would be done. So 1 is an element of A and P(1) is true.

Let P(k) be true.
If k+1 is in S, while no element from 1 and k is in S, then k+1 would be the least element in S. Therefore (k+1) is not an element of S. Thus P(k+1) is true and by Mathematical induction, A=\mathbb{N} and S is empty.

Therefore, we have a contradiction as we assumed S to be non-empty. Therefore if S is non-empty, it must have a least element.

Tuesday, 18 November 2014

Week 10

This past week, we continued lessons on Big Oh and Big Alpha. We talked about general Big Oh statements rather than proving whether certain functions, or if the Worst case Insertion sort is in the Big Oh or Big Alpha of a particular function. The material felt a little more challenging at first and strange as well. This is due to the fact that I am more used to using functions to see if one function is in the Big Oh of another or not. However, these proofs require me to use the definition of Big Oh more thoughtfully than before. Sometimes, it is hard (at least for me) to figure out which B or which c to pick to satisfy a claim.
For example:
For all f, g in F, if f is in big Oh of g, then g is in big Alpha of f.
This claim is true, because if f grows no faster than g, then g grows no slower than f.
But which B and c to choose as per the definition!?
If f is in Big Oh of g, then there exists some c and B such that for all n, n ≥B implies f ≤ c*g
Then f*(1/c) ≤ g
Then choose c' = 1/c and choose B' = B to prove g is in big Alpha of f.

This is the thought process that I have difficulty applying to many cases.

One thing I found very nice this past week is that Professor Heap walked us through many general statements. Instead of just doing the proof, he asked us to think about and do every step of each proof as he did them in class to get us to think about it and learn effectively. He explained most steps graphically as well to illustrate why a particular B or c is chosen and to show us what is going on.

In order to improve my skills, I will need to go to Prof Larry Zhang's slides to look for some problems he may have presented in class and attempt to prove some general statements myself. If I have difficulty, I will look at the thought process he presented and then attempt to do the proofs myself. If I have difficulty, I can look at the solution and learn from it, and keep doing more problems. This secondary resource (Prof Larry Zhang's slides) can be used to my advantage in this way to help me improve my skills. I will also work on the tutorial exercises the weekend before the tutorial in order to gain mastery of the material before the quiz, to prevent last minute panicking!

I feel as though my experience this week is similar to that of another blogger in his/her November 17 blog (http://kbslog.blogspot.ca/). This blogger also feels as though this week, the introduction of general Big Oh proofs feels a little strange since we are used to Big Oh proofs with straight forward functions. I also had a hard time following Prof Danny's explanations on Friday similar to this blogger, as the problems got more complex, but I was able to follow the more simple statements on Monday and Wednesday. In this case, both the blogger and I should go back and take a look at the annotated slides and work on understanding this Friday's material.

Monday, 10 November 2014

Week 8-9

This past week, we continued to talk about Big Theta and Big Omega. We took polynomials and proved if they are in big Oh of another polynomial. We did the same sort of examples for Big Theta as well. I feel as though I have improved in my understanding of Big Theta and Big Oh since last week because I understand the proofs given to us in class and I am able to solve similar problems myself.

I personally feel as though the big Oh problems presented last week are simple enough to solve. If we are to prove that a polynomial is in the big Oh of another polynomial, we simply over estimate the left hand side and underestimate the right hand side until we get both polynomials to have the same highest degree, and we set the breakpoint to be 1. Although there are many ways to prove a polynomial is in the Big Oh of another polynomial, this way works for me the best.

One thing I find difficulty in doing is proving a polynomial is not in the Big Oh or Big Theta of another polynomial. One way I can practice doing this is by going to the other professor's website and take a look at his examples, and try them on my own. I believe this will be an excellent way for me to practice using the concepts learned in class, and if I am not able to solve the problem, then the proof will be there for me to learn from. I believe this will sharpen my skills in disproving big Oh problems. I also need to practice some of my calculus skills in order to prove some functions are or not in the Big Oh of other functions, because L'Hopital's rule can come in handy, and I haven't been differentiating well lately since I dropped MAT137 (since I my transfer credits for calculus got approved).

I find that my experience is similar to that of another blogger (http://tsod165.blogspot.ca/) in her Week 9 blog. This blogger feels that there is some overlap between CSC108 and CSC165 when it comes to learning about run times. This makes the content of CSC108 easier. I also think that the test went well and was fairly simple, and I am happy to see that bloggers like this one feel the same way. However I don't agree with the blogger when she says that "I realized that the same technique used for the proof of \floor{x+1}=\floor{x}+1 doesn't necessarily work for \floor{x+z}=\floor{x}+z."
Assume x∈ℝ
 Then ⌊x⌋ ≤ x #By definition part 2.
 Then ⌊x⌋+1 ≤ x+1
 Then ⌊x⌋+1 ≤ ⌊x+1⌋ #By definition part 3, because ⌊x⌋+1 ∈ ℤ.
 Then ⌊x+1⌋ ≤ x+1 #By definition part 2.
 Then ⌊x+1⌋ -1 ≤ x
 Then ⌊x+1⌋ -1≤ ⌊x⌋
 Then ⌊x+1⌋ ≤ ⌊x⌋+1 #By definition part 3, because ⌊x+1⌋ -1∈ℤ by definition part 1.
 Then ⌊x+1⌋ ≤ ⌊x⌋+1 ∧ ⌊x⌋+1 ≤ ⌊x+1⌋ #Introduce ∧
 Then ⌊x + 1⌋ = ⌊x⌋ + 1 #Equality
∀x ∈ ℝ, ⌊x + 1⌋ = ⌊x⌋ + 1 #Introduce ∀

I believe that by replacing 1 by z in the proof above, where z is any integer, will prove that
∀x ∈ ℝ, ⌊x + z⌋ = ⌊x⌋ + z. I don't see how the same technique can't be used because z has the exact same properties as 1 does.

Tuesday, 28 October 2014

Week 7

This past week, we ended off with the unit on proofs by learning some very important rules. Although we have been talking about proofs for a long time, this week we went into detail by talking about proofs by cases, which I found to be pretty easy, but like always, even though the concepts seem simple, approaching a problem is not easy. Some rules that I found a little confusing are:
implication elimination: If you know A implies B, the additional information A allows you to conclude B. On the other hand, the additional information not B allows you to conclude not A.
universal elimination: If you know for all x in X, P(x ), the additional information a in X allows you to conclude P(a). 


Although I understand that the first statement has to do with the contrapositive, it is hard to imagine it as true logically. Also, I don't understand the meaning the of the universal elimination rule.

We also started talking about algorithms. Specifically, we talked about the run times of algorithms. We started off with a while loop and we talked about the number of steps the algorithm would take in the worst case. When I practice with this, sometimes I forget to add the loop guard as well when counting the steps, but like always, I need to work on practice problems to get better at this. We also introduced the formal definition of the big Oh. Although this week, we didn't work on proving statements involving the big Oh much, we did talk about what it means for a function to be in the big Oh of another. It has to do with growth rate. If a function has a smaller growth rate than another function, it is in the big Oh of the function with a larger growth rate.

I found counting steps a little confusing in the beginning. Why do we have to account for the loop guard within a while loop and again for outside the while loop? I will need to visit a prof during office hours to receive assistance with this concept.

Similar to what the blogger (http://yahuiliuslog165.blogspot.ca/) said in his/her blog on October 29, I understand the basic idea of big Oh, but if I were to be asked to write down the definition, I would struggle. My experience this week is similar to that of the blogger of whom's link I included. We both feel as though we need to practice with examples and work with it to become proficient with the concept and to be able to write down the definition formally. Hopefully we will work with it more in class in the days to come.



Tuesday, 21 October 2014

Week 6

This past week, we continued to talk about proofs. We emphasized on using the proof structure. We also talked about how to immediately approach a problem in which we have to prove a statement. If we have a statement that uses quantifiers, we have to assume that the domain if there is a for all statement, and pick a value for a variable if that variable is followed by an existential quantifier. We also have to assume the antecedent. For every quantifier, we have to indent when we pick a value of the quantifier or assume the domain, as well as assuming the antecedent.
For example:
∀ x ∈ ℝ, ∀ y ∈ ℝ, x > y ⇒ ⌊x⌋ ≥ ⌊y⌋
Assume x ∈ ℝ. # Domain assumption for x.
   Assume y ∈ ℝ. #Domain assumption for y.
       Assume x > y # Assume antecedent .


       Then x > y⇒ ⌊x⌋ ≥ ⌊y⌋  #Introduce ⇒
   Then ∀ y ∈ ℝ, x > y ⇒ ⌊x⌋ ≥ ⌊y⌋   #Introduce ∀
∀ x ∈ ℝ, ∀ y ∈ ℝ, x > y ⇒ ⌊x⌋ ≥ ⌊y⌋   #Introduce ∀

The middle part is the proof. Once we prove a statement, we state what we have proved at the end by indenting sequentially. This is the structure we always follow, and like I said above, this is how we approach every problem in the beginning, whether we know the proof or not, because this is what gets us going. Then we think about what to put in the middle that will show the validity of the statement. This is a very useful technique because it makes the proof easy to understand and read. It also helps to keep us organized.

Similar to the October 18 blog of this blogger (http://csc165progress.blogspot.ca/), we both find that we have to do similar proofs in MAT137 and CSC165. However, in CSC165, we have to use a specific type of structure and organize it in a specific manner, and similar to what the other blogger mentioned, I also lose marks if I don't use words or a small paragraph to explain what I am doing. Sometimes my entire proof in MAT137 is a paragraph with math steps inside the paragraph.

One way I think I can improve on using the structure effectively is by proving statements that I already have proved in MAT137 and using the structure of CSC165 on those statements. I believe that this will effectively improve my ability to use the proof structure properly, and I won't have to worry about thinking about the contents of the proof much. This will give me an opportunity to directly practice my ability on using the proof structure.

Tuesday, 14 October 2014

Week 5

This past week, we continued talking about proofs, and we learned some more proof techniques. We learned about proof by contradiction, and we continued to use the contrapositive. One useful technique I learned is that when we have trouble proving a statement, we can take the contrapositive of the statement and use a direct proof for the contrapositive. This is equivalent to proving the original statement. This is especially useful when proving 'if and only if' statements.
For example:
For all integers n, n is even if and only if n^2 is even.
It is difficult to prove that if n^2 is even then n is even. So we can take the contrapositive and say:
If n is odd, then n^2 has to be odd.
Then we can use a direct proof to prove the contrapositive:
Let n=2k+1 for some integer k.
Then n^2= 4k^2 + 4k + 1= 4(k^2 + 4k) +1, which is odd.

Although I didn't use the proof structure above, this example is one way where using the contrapositive can be very useful.

Looking back at the annotated lecture slides, I find it difficult to prove some statements without looking at the solution and memorizing it. One way I can improve my skills to prove basic statements is by practicing by tackling some problems myself on the practice section of the course notes. I can also find some problems on the internet and try to prove some theorems using the skills learned in class, so I can become better at solving problems.

My perception of what I should do to improve is similar to that of another blogger. On the last paragraph of the Week 5 slog (http://csc165maks.blogspot.ca/), this blogger also feels that to get a better grasp of the content, he/she needs to solve problems and practice herself. She also feels that using the contrapositive in many situations can make a problem much more simplified, so that is always something to consider and think about when having difficulty proving something directly.

Monday, 6 October 2014

Week 4

This past week was a thrill. In the beginning of the week, I had a lot of trouble understanding the material covered in the tutorial, (proving equivalencies of implications and statements), but after receiving the solutions to the tutorial excersices in the tutorial, I began to understand how to form the proofs and use the laws properly to prove equivalencies. I am happy that I am finally beginning to understand the material in this class.


I am happy that we used Venn Diagrams in class to illustrate the associative property and the distributive property in class. It showed me how the laws are true, although one of the distributive laws seemed surprising, as we don’t use the same logic in our everyday conversations. I also found that working on the assignment improved some of my skills as it made me focus on the material and sharpen my skills, especially when it comes to negating implications and writing in symbolic form. However, the one thing I still struggle with is coming up with an example for making an existential statement true and a statement involving the intersection of two sets false. I am referring to Question 4 of the assignment. I learned that making the antecedent false and the resultant true can still mean that the implication is true. It is called ‘vacuous truth’. Overall, working on this assignment was a wonderful experience.

I think that finding problems like these on the internet and asking the professor for practice problems will sharpen my skills with the course content. Also, drawing out Venn Diagrams myself of some of the laws of logic will help me understand why those rules are true. It is nice to see the professor do it, however doing it myself will ensure that I understand the nature of the laws.
I feel as though my experience in the course is different to that of another blogger (http://yahuiliuslog165.blogspot.ca/), who in his/her week 4 blog, mentioned that this course has similar content to that of MAT137. The blogger also said that he/she finds the concepts of this easy. I do not find the concepts easy and I feel as though we manipulate quantifiers in limit type proofs in this class. In MAT137, we did not go into depth of what a limit is formally. We learned the formal definition and learned how to use it. I find it interesting that for this blogger, the proofs in MAT137 seem to help him/her in this course.


I look forward to preparing for the test this coming Wednesday!

Saturday, 27 September 2014

Week 2-3

This week we learned about conjunctions and disjunctions and we applied them to implications. I learned about some of the laws involving conjunctions, such as the law of associativity. At first, it was hard to see how statements in the laws were equivalent. It was very helpful drawing Venn Diagrams in class to show how some laws are equivalent, and it was an interesting experience to see that. However, sometimes, it understanding these laws come over time, but applying them and using them in proofs can be very confusing. I also was pleased to learn Polya’s approach to solving problems. It gives a nice framework of how to approach and tackle a problem successfully, which could potentially be very resourceful when stuck on a problem. I had difficulty using Polya’s approach when solving a problem of patterns created when folding piece of paper once, twice, three times, four times, and five times because my natural instinct was to jump into the problem and figure out a pattern without carrying out the steps in Polya’s approach. It was a great exercise. I will say that the exercise conducted of folding a paper was a good experience because we used Polya’s approach in class.

The tutorial exercise was very confusing for me, but doing the quiz was a useful experience because it gave me greater insight on how to interpret language involving logic. However the quiz was only useful because I was able to learn from the mistake that I made on the quiz. I did not do well on the quiz. 

One way I can improve in the course is by working on the tutorial exercises before the tutorial starts, so I can be ready for the tutorial and ask questions that I do not understand. Also, this can improve my performance on future quizzes.