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.

Saturday 18 October 2014

SLOG week 6

   This week we discussed the concept and definition of a limit. I like limits. The discussion of them has reminded me of what we discussed so long ago in the first week of class, namely, absolute precision.
   Visualizing and "feeling" a limit is quite simple for a given function. If the limit of f is, say, 20 as x approaches 10,  you can easily imagine the line representing the function getting closer and closer and closer and closer to 20 as you start just to the left of 10 and move along the line. It is intuitive, like many concepts in maths.
   The definition of a limit, on the other hand, is not very intuitive at first glance. That is why it makes me think of the absolute certainty of it. It looks unnatural when you look at it the first few times, yet it makes so much sense and it successfully lays out the concept with such precision. If you were to say "well, the function just approaches the limit as x gets closer to the given number", then there are many ways in which people might misunderstand you. Such is the imprecision of the English language; you can explain mathematical concepts, but not without ambiguity. The precision of the mathematical symbols and definitions, however, means that,as long as the symbols and equations are understood, the concept will be captured with complete accuracy. It is not ambiguous.

Saturday 11 October 2014

SLOG week 5

   I do not want to spend all of my SLOG posts praising the course and the teaching, but for now, I will, because I am still enjoying it and learning well. So far, my favourite aspect of the course has been the way that it has focused--just as the course title implies--on reasoning and logic more than facts and memory. I have learned, so far, to think a certain way, and I find that the course material has overseen this exceptionally well. When I began the first assignment, I remembered much of what I had learned in class,  but I had not used it yet. The assignment forced me to go back, review, apply the concepts, and, finally, to internalize them. I was immersed in the practice of Boolean algebra and implication, and I really had to understand them to complete the assignment. Because of the assignment's forcing me to internalize the course concepts, it prepared me excellently for the test.

   My thoughts on the first test: I felt confident and comfortable with the material. After completing the first assignment, I felt totally prepared. The only real problem I had with it was that reading the Python functions and trying to follow them while under time constraints was a bit difficult, especially because I had to remember which one fit with which definition and then I had to retain that information to apply it to the next question. I basically ended up doing this by sorting it out first, then writing it down, and then quickly referencing my writing on the next page to recall the necessary function. This turned out to be a bit confusing, and I think I might have lost a mark just because I was flipping between pages and referencing the things I had scrawled next to each function without necessarily thinking it through each time. Either way, though, it was an interesting test.

   The last question was strange when I first read it. Presumably just as it was meant to, it pushed my logical intuition at first, because it called for sets P, Q, and D such that one of the following is true:


  • There exists an x in D such that P if and only if Q.
  • There exists an x in D such that P and Q.
   I understood the difference, but at first, I could not quite think of an example of sets that would fit. Eventually, I realized that picturing it as a Venn Diagram was really easy: if D was the universe, in the first one, the only occupied part of the diagram would be the overlap between the circles. On the second, the circles should overlap, but some other part of the diagram would have to be occupied as well. This led me to the easiest thing I could think of, which is a solution that would make P and Q  true, but such that P is not necessarily dependant on Q and vice versa. This satisfied the question, though I cannot remember exactly what I chose when writing. 
   The other way to satisfy the question, of course, would be to make the first statement true and the second false. The only way I can think of to do this is to make it true through vacuous truth: if every element in D falls under neither P nor Q, then the statement will be true and the second statement will be false.

   Taking a look at some other SLOGS, I see that there generally, people were comfortable with Test 1. http://slog-christone.blogspot.ca/ here is one (look under week 5).  This seems inevitable; though I congratulate myself for finding it easy, the fact is that it was easy because it was very much representative of what we have all learned so far, and no more than that. It did not really "stretch" our understanding of the concepts, so whoever understands the course well at this point was bound to do well. 

Saturday 4 October 2014

SLOG week 4

   I am enjoying proofs. Last year I took MAT137, and, though that was a real maths course, I think this course is introducing me to the concept better than that one did. Of course, we have only done very, very simple proofs so far, all of which depend on algebra that would come easily to most people, like showing that if y = 10x, then y(squared) = 100x(squared) or something like that.
   Still, though, I admire the elegance of the process: you assume some antecedent, and if you can naturally derive the consequent from that antecedent, you can prove the implication. The few that we have tried in class have been simple enough and very understandable. I look forward to getting more advanced.
  

Saturday 27 September 2014

SLOG week 3

   I have greatly enjoyed the course up to this point. This unit is on implication and boolean algebra. I enjoy using it to make concrete sense out of concepts that previously seemed to be very human. Of course, implication is something that is ubiquitous in human interactions and thought; almost any statement contains something resembling a "P implies Q" implication.
   I am surprised at how much I am enjoying the first assignment. The exhilaration of problem solving that Danny mentioned in the first class is very real; slowly pulling apart each statement given in assignment 1, discerning what is and what is not able to be said with logical certainty, is great.
   One of the things I noticed when it comes to this course is that Danny has taught us quite effectively about being conservative with our statements. When moving through each question, I am very confident in identifying what is and is not true. In previous years, I might have felt satisfied with merely suspecting the validity of my answers. In this course, I am able to analyse my thoughts on the questions, stopping after every antecedent, consequent, etc. to reflect on whether or not I could say each thing, not only with confidence, but  with certainty.
   

Friday 19 September 2014

SLOG week 1

   The first week of CSC165 was not very challenging because it was a very, very simple introduction to the first unit. We learned about being precise with our words and mathematical symbols, and the proper symbols to use to be most precise. We went over the ways that the English language can fail us when we mean to be absolutely understood, with not even a hint of ambiguity. Some of it was amusing, like when we went over some newspaper headlines that attempted to capture some story or concept with a few words and utterly failed to do so.
   The biggest thing I can say at this point is that I am interesting to see where we go from here. The first week was, ironically, quite ambiguous. I do not quite understand what it has to do with whatever mathematical concepts are coming, but I look forward to refining my understanding of this week through the lens of whatever we learn in the course.

SLOG week 2

   It is the end of the second week of the fall semester, and I have now attended six lectures and one tutorial of Mathematical Expression and Reasoning for Computer Science (CSC165H1). The material so far has been simple, and so too, at this point, are my thoughts and reflections. Still, six lectures adds up to five hours total, and five hours adds up to many words spoken, topics discussed, and questions and answers considered, so there is at least a bit to say at this point.
   The concept of implication has so far been the most interesting and challenging part of the course. It is simultaneously sensible and at odds with my--and most people's, I'm sure--intuition. The fact that a statement can be made such as "All the orange snakes in the lecture hall have buckteeth", and this statement, from a logician's point of view, is correct, is bizarre. Of course, the quality of being true, from a logician's point of view, is different from that of your average Joe, who plays fast and loose with logic. To a logician, any claim can be made about the empty set because there are no counterexamples within it.
   A thought on this: it feels, in a way, like a "cop-out". The concept of vacuous truth is upheld because it fits with the logician and mathematician's established methods of proof and disproof. A universal claim is disproved only by a counterexample, but, in a sense, that is only because of the limited faculties of people. People cannot assess infinite or extremely large amounts of data to completion, checking if every example is one that fits the claim - if they could, we would do this to prove claims about sets. But because people simply cannot, the method adopted by logicians and mathematicians--who, just like the rest of us, have limited processing ability--is to look for a counter example and, if one cannot be found, declare a claim to be true. It is because logicians need to say their method of proof is universally applicable and infallible that they claim it is also applicable to the empty set--and this is why, with their method, the empty set can "truthfully" be assigned any quality. I say all this because, no matter how much it can be explored and verified with logical and mathematical language, it isn't really true, in the human sense (which should not be dismissed, though it might not have much place in this course), that all the orange snakes in the lecture hall have buckteeth.
   So, in a sense, I think that vacuous truth is sort of a bi-product not of genuine logic as much it is a bi-product of the human brain using its limited faculties to make an attempt at genuine logic. If we could not prove things, we would not be able to get very far in the fields of math or logic. To prove things, though, we can only use our measly little brains, and vacuous truth is implicit in knowing that our own methods work.