Tuesday 2 December 2014

SLOG final post

   So, I completed Assignment 3. Of course, I badly messed up Assignment 2, but still, I found Assignment 3 fairly doable.
   The questions were all proofs. I think I have refined my proof technique, so they went okay for me. The proofs using the limits I particularly enjoyed, because I really enjoy bringing one mathematical definition (such as for a limit) into a proof for a different concept, and actually being able to take variables from one and put them into another and seeing that the math fits so beautifully together. It is a great way to see just how math is not in any way arbitrary; it is derived basically from logic, and it is always true. Studying big O might seem forced and obscure, but seeing the limit definition and then playing around with it in the big O proof put it all the perspective of maths being a collective, interconnected topic.
   The exam is a week tomorrow. I think I have done okay in the course, and I have worked hard enough on my major mistakes that I think they will help me study, really. If I had to make one guess about on what will I most focus when studying, I would say Big O proofs and Computability and algorithm complexity. Those are the only things that still seem sort of rough to me, though I have got through all the examples I have seen okay.
   Overall, then, I can say that I really enjoyed this course. The assignments were fascinating and, luckily, I did well in general. I look forward to more maths.

   Taking a look at some other SLOGS, I found this one http://quinn165.blogspot.ca/ (check out the last post, from yesterday, Dec 1) which I think is sort of funny. They talk about how they are doing MAT137 right now, so the induction we've been going over is not much help. I agree; I did MAT137 last year, which had a whole unit on induction (also at the very end of the course--not sure why induction is such a end-of-year kind of topic), so I have not really been informed of anything that I did not already know. Otherwise, this person talks about their confusion with regards to computability and halting and all that. I would agree with that as well; it is a strange, obscure topic for us who are just getting introduced to Comp Sci. Perhaps in the future, the class should cut out the induction and focus more on making the computability and halting topics make sense to the students? Oh well, just a thought.

SLOG OUUUUUTTTTTTTT!!!!!!! have a good future and bye forever :)

Thursday 27 November 2014

SLOG week 12

   This week has been troubling and it has challenged not just my skill set, but my endurance with this course. I found out that I did awfully on assignment 2--this after screwing up test 2 as well.
   The problem with each of them, it seems, was fairly similar and quite depressing. I have really enjoyed this course and I have put a lot of effort into internalizing and understanding the material, and yet my mark has been damaged by something more fundamental than logic, boolean quantifiers, proofs, etcetera: paying attention. On my test, I spent so much time and so much scrap paper trying to jot down notes to figure out my answer to question 2 that I forgot to add any structure to the proof and I never took note of the fact that the little I did include was simply incoherent; on assignment 2, I read statement 1.2 wrong, not taking note of the order of the variables, and so wrote a long and extensive proof for something that, had I read more closely, I would quite easily have understood to be false. Further than that, I did not include the proofs of the converses in the last two questions; I completely failed to see that part.
   This is definitely irritating and frustrating, but, after some serious self-pitying, I decided to "pull my boots up" and not give up on the course. I know what I did wrong, and though I lost many marks, I can still end with a good mark if I pay attention to my prior faults and I try to learn.

   In question 1.2, basically what I did was prove something like the reverse of the statement. What my answer in theory meant is that if you know the absolute value of the difference of the floor of two numbers is e, you can say that the absolute value of the difference of the two numbers will be no more than e + 1. Of course, this is a vaguely similar idea to what the question asked, but "vaguely similar" is very different from "the same". I screwed up, big time. However I am reflecting and taking a look at my paper. I am still proud in a sense because I really enjoyed writing it. Previously I was scared of proofs, and with assignment 2 I genuinely felt stimulated and happy writing them. That is a big step. The fact that I did not read it close enough is something that I will just have to learn from.

Sunday 16 November 2014

SLOG week 10

   I'm feeling more comfortable with this unit. The concepts of "big-O" and "big-Omega" and "big-Theta" are sinking in a little more. Basically, they are methods of determining the growth of a function. The definitions require an x-value B for which one function will predictably be larger, smaller, or equal to the other function when it is multiplied by a constant. I have to say that, because of my alienation with this topic that I discussed last week and which is only now starting to dissipate, I have been sort of confused when following the algebra of the "big-O", "big-Omega", and "big-Theta" proofs that we did this past week and last week.
   Because of this, I now have my new challenge: I have to figure this out. In class, nothing Danny did was too difficult, at least from a maths standpoint. It was algebra and simple manipulations of inequalities, mostly. But I just did not follow it well because I was preoccupied with trying to figure out the core of the concepts. Now, then, I have to review and go over it.
   Basically, what I understand so far (and I will use "big-O" specifically):

  • To complete the proofs, you need to find the positive constants B and C.
  • For polynomial functions in these proofs, it basically comes down to manipulating inequalities.
  • The term in the polynomial of the highest degree is the most important part: all the other terms do not affect the growth of the function nearly as much. 
  • Because of this (and this is my favourite part of the proofs so far), you can basically ignore the smaller terms and, as you need, replace them with multiples of the highest degree term to further the inequality. For example. if you have f(n) [less than or equal to] 3(n squared) + 16 then you can take out the +16 and replace it with (+n(squared)) for all n over 4. Then you can add up those terms since they are alike. 
  • The other proofs, e.g. "Big-Omega" and "Big-Theta", are very similar, but the inequality is reversed.
That is a list of what I do as yet understand. I need practice to further my comfort with it all, but I can "see the light" as of now when it comes to these concepts. The biggest thing by which I am still confused is how to do these proofs with non-polynomials, e.g. log functions or exponential functions. That will have to come next for me. 

Saturday 8 November 2014

Slog week 9 second post

   I wrote the second test, and I had mixed feelings about it.
   The first and the third questions seemed okay. They were straightforward direct proofs which I luckily navigated well and I think I found my way to the correct algebra and methods. The second question, on the other hand, gave me much more trouble. I think I might have panicked over it, and the whole process of proving it, which I completed, felt very loose and messy. I had to cross out many things.
   Looking back on it, the second statement seems fairly intuitive. Basically, it states that if you know w is greater than some number d, then you know that floor(w) is greater than some number e. This makes intuitive sense, as the size of w and floor(w) are of course related in a very predictable way. I believe what I ended up doing is using d = e+1, though I cannot quite remember. It was something like this, anyway. This seemed obvious, but it led to me having also to show that floor(e+1) > e, which, though simple, was enough of a distraction that I think it might have effected my test.
   I will re-examine this problem, then, for my SLOG problem solving post which is required. Of course, it is not mind bending, per se; rather, it is a simple problem and the real trick is being able to proof it clearly and precisely.

1. Understand the problem
   This step is not difficult. I have to prove that floor(e+1) > e, which means that the largest possible integer which is less than or equal to (e+1) is itself greater than e.
   It intuitively makes sense. if e is not an integer, then floor(e) will be the integer just to the left of e on the number line. Floor(e+1) will be the integer to the right of floor(e) on the number line, so e itself will sit between them and we can picture pretty clearly that it is less than floor(e+1).

2. Devising a plan 
    To show this, I will use the same definition of floor(x) that we used on the test and the assignment:

floor(x) [belongs to] Z ^ floor(x) [less than or equal to] x ^ ( [for all] z [belongs to] Z, z [less than or equal to] x [implies] z [less than or equal to] floor(x) )

   Now I have to lay out the foundations of my proof, which will be:
  • floor(e+1) is an integer
  • floor(e) is an integer.
  • floor(e) is less than or equal to e.
  • floor(e+1) is less than or equal to e+1.
  • e+1 is greater than e.
This facts connect  e, e+1, floor(e), and floor(e+1) to my definition, which allows me to use them in my proof.
   Now, my first thoughts:
  • in CASE 1, e is an integer. In that case, it is simple to say that since e is an integer and it is less than e+1, by the definition of floor(x), e is an integer and e is less than or equal to e+1 so e is less than or equal to floor(e+1). e+1 is an integer if e is an integer, so floor(e+1) is equal to e+1. Then since e is less than or equal to floor(e+1) and floor(e+1) = e+1, we know that e is less than, rather than equal to, floor(e+1) because obviously e is not equal to e+1.
  • in CASE 2, e is not an integer. In this case, it is the same logic but there are more steps applied which makes it a bit more complicated. e is less than e+1, and there then exists some integer between e and e+1; we will call it k. It is safe to say that k is equal to floor(e+1), because k is an integer and it is less than e+1 but no other integer less than e+1 is greater than k. Then we see that floor(e+1) is less than e+1 and greater than e.
These notes fit pretty well into a future proof, so I will now make sense of them and write them out into a full proof that floor(e+1) is greater than e...

3. Carrying out the plan

First, the formal statement: For all numbers e belonging to the naturals, floor(e+1) > e.

Assume e belong to the natural numbers. #assume domain

   Case 1: e is an integer.
      Then floor(e) [belongs to] Z ^ floor(e) [less than or equal to] e ^ ( [for all] z [belongs to] Z, z [less than or equal to] e [implies] e [less than or equal to] floor(e) ) #definition of floor(e)
      Then since e belongs to the integers and is less than or equal to z, by the definition of floor(e), this implies that e is less than or equal to floor(e).
      This in turn implies that floor(e) = e.
      If e is an integer, then e + 1 is an integer.
      The same logic can be used to arrive at the conclusion that floor(e+1) = e + 1 #since an integer      plus an integer is equal to an integer.
      Taking this all into account, we have that e is an integer so e + 1 is an integer, and floor e is
equal to e and floor(e+1) = e+1. Therefore: floor(e+1) = e + 1 > e = floor(e) so floor(e+1) > e.
   Case 2: e is not an integer.
      Then e +1 is not an integer,
      Then there exists a k between e+1 and e which is an integer.
      Then we have the inequality e+1 > k > e.
      Then k [belongs to] Z ^ k [less than or equal to] e+1 ^ ( [for all] z [belongs to] Z, z [less than or equal to] e+1 [implies] e [less than or equal to] floor(e+1) )
      So, taking this definition of floor(e), we can say that k is an integer and it is less than k.
      Then because k is less than e+1, by the implication, we can say that it is less than or equal to floor(e+1). Because k is the integer between e and e+1, then, we can say that k = floor(e+1) #since it is between e and e+1 and it is less than or equal to e+1.
      Then since e+1 > k > e and k = floor(e+1), we have floor(e+1) > e

Then for all e in the integers, floor(e+1) > e

4. Looking Back
   The proof seems to hold up, reviewing it after a few minutes. Of course, it is not a complex problem, but sometimes the simplest ones are hard to prove, because, in theory, they "go without saying". But that is what proof is all about; nothing goes without saying. My proof, then, was quite wordy and I think it partially has to do with typing/word processing. It is a bad process to type out mathematical concepts, so that led me to typing it in words, which comes with its own problems. Overall, though, it seems okay. With another definition of floor(e), I definitely can see how I might go about proving this again.

Looking over some other slogs, I see that people had similar trouble with the second question. Here's one that I found : http://gonzzang.blogspot.ca/ (look at the post for week 9) and it says, just like me, that the poster found the second question to be tricky. That is somewhat comforting. It seems like mixing multiple concepts--like floors and limits--is tough, at least when it is given to us with such a time constraint.

Tuesday 4 November 2014

SLOG week 9

   The second assignment was difficult but rewarding for me. I had a very easy time with the last questions--they were of the sort that I referred to in an earlier post, in which you start with one or two variables that are given certain equations, and multiply/manipulate them to show that some dependent variable (e.g. the square of the first one) is equal to another related equation. Of course, I may have done them incorrectly, but from where I stand now, I would say that I was unchallenged by them.
   The first questions, which depended on the floor function, were a good deal more difficult. The fact that we had to decide for ourselves whether or not we thought the statements true made them a good deal more difficult. The first time I sat down and worked on the assignment, in fact, I spent the whole the time staring at the definition of the floor of x and at each of the statements involving the floor of x and simply trying to wrap my head around them. I jotted down notes and wrote out each statement in basic English, and i found myself having to write the statement down in English again and again to refine my understanding of it. After quite a while, I had several pages of notes on every statement and exactly how it might or might not be true. They had started out as obscure and baffling, but after this long process and after I had nailed down my understanding of them, they became quite fascinating and very understandable.
   The thing I had the most trouble with in the assignment was the statement

[for all] x in R; [for all] e in R+, [there exists] d in R+, [for all] w in R, | x - w| < d [implies]  |floor(x) - floor(w)| < e

which I have written here with the limited abilities of this given word processor. I hope it is legible.
   The most difficult part, for me, was that d could depend on x and on e, but it could not depend on w. I had a whole solution sorted out in which d was equal the absolute value of the differences between x and floor(x) and w and floor(w), but I had to start over when I realized that d could not have x in it. Luckily, it worked out (I hope, given that I have not got the assignment back yet) because I was able to show that this absolute value was less than one, so I could use a series of inequalities in which d was equal to one but I could still fit my absolute value involving the differences of x and floor(x) and w and floor(w) in. With this little trick, I think I got through the assignment okay.
   The second test is tomorrow, and I feel pretty comfortable that the assignment prepared me well for it. We shall see.


***Amendment***

   I feel pretty stupid, reading over this post. Of course, my answer for question 1.2 of Assignment 2 was completely wrong. I was thinking I might delete this post in light of that, but I have decided to let it all hang out and simply view it as a lesson. I have a theory on how it all happened.I remembe very distinctly my first night working on Assignment 2. I did not understand several of the statements at first, and so my biggest challenge was to try to wrap my head around them. That I did; slowly but surely, I began more and more to see what the symbols really meant, and to intuit it.
   Sadly, that is where I stopped. I was so exhilarated by having finally begun to see the meaning that I didn't bother to see that process through to the end; I simply developed a rough understanding of it (as in, "This has to do with the relationship between the difference of the floors and the difference of the numbers; let's think about that!") and then so congratulated myself for making some progress that I did not think even more deeply about the meaning of the statement. If I had, I would easily have realized that there were some nuances I was fatally missing when I considered it.

Saturday 1 November 2014

SLOG week 8

   We are now into "big-O" notation after having completed the proof unit. I have to say that this new topic is somewhat confusing to me. I understand that what it comes down to for us in terms of work and application is these "big-O" proofs, where you show that one function is in "big-O" of another function (or that it isn't).
   The confusion for me, though, comes down to the motivation of this topic; I don't really understand why we need "big-O". I suspect that it is an important topic in algorithm analysis, which itself is a topic quite specific to computer science. Because I have not learned all that much about computer science (since I am in the first year of it), this "big-O" is sort of lost on me. Past topics have been more intuitive and connected broadly to maths and logic. 
   I suppose this is my biggest frustration this week: I want to be more interested in the concept of "big-O", but I am sort of prevented from being so because I do not understand the connections it has with the wider picture of logic, maths, etc. I will keep working on it, though, and once again, hope that it will be interesting and valuable to me when I look back on it through the lens of what is to come.

   It seems that some other people don't understand either. Here is a slog I found (check the post from oct 31, yesterday) http://vickieou.blogspot.ca/ which agrees that in general, the big O concepts are confusing. They also raise the point that the proofs require a lot of note taking in class. I think that is a smart and funny observation which is also true for me; I was pretty much constantly writing in this week's lectures, and just the act of taking notes alone took away somewhat from my attention. Maybe that is a sort of "hidden variable" (referencing my Statistics course, boo-ya) with this unit: it is wordy, so it is harder to take it all in. 

Monday 27 October 2014

SLOG week 7

   One of the challenging parts of the proof unit so far has been that much of the technique seems jarringly obvious when it is explained, yet in practice it seems like it would be quite obscure and very easy to fail to see. Obviously, I will have to explain this thought a bit...
   In a recent lecture, Danny went over several "proof techniques" including direct proof, indirect proof, inference rules, existential instantiation, disjunction elimination, implication elimination, universal elimination, etc. These, the way he put it, are very obvious. Universal elimination means that if you know every element of a set has a certain property, then you know that a certain given element of that set also has that property. This is the kind of thing that seems to go without saying. Indirect proof is the practice of assuming the negation of the consequent and deriving the negation of the antecedent. These concepts, as well as many others that we have learned, seem very obvious when simply written out.
   The problem comes with the application of these concepts. So far, with the proofs I have encountered, I basically go right for the direct proof and hope it works. If I can't get it to work on the first try, I go back to the "scratch work" and then hope to try again. At this point, I lack the confidence to know that certain situations calls for other proof techniques. It is almost as if they seem so obvious and intuitive to me that I do not know what really sets them apart from each other, and how they are appropriate for certain unique circumstances and not for others. I think I have only done one or two indirect proofs in class/tutorial, and when I did, it was because I had been told by the instructor/TA that indirect proofs were necessary for the given question. In a test or exam, I am not so sure that I would be able to clearly tell that indirect proof or any other sort of technique that is not a simple direct proof is necessary. I also would have a hard time discerning between all of these techniques and knowing exactly which one I was using, and I do not know whether or not that is entirely necessary or not.