Since an invariant is An assertion that some property must always hold, one easily comes to the conclusion that a loop invariant is a property that is always true for the duration of the loop. Having just finished covering loop invariants in this weeks lectures, I began to try and apply the concepts we had learned about program correctness to the next assignment I had gotten from csc207. By and large I found it to be an incredibly helpful, albeit time consuming, way to ensure that my functions were closer to success on the first draft of code and that they were overall more successful and stable in the final draft of coding. I'm also hopeful that, since I took a much more rigorous approach to convincing myself my code would work, I should be able to provide much more useful and insightful documentation for my code.
We also had the second midterm, I find that i'm studying far less for csc236 then I had for csc165, but am understanding the material much better and thoroughly. Last year I found myself devoting more time to attempting past tests to understand the material, rather then reading over the course notes I had made, and ultimately I feel it was a far less effective study method. As I continue to refine my study techniques I find myself far less stressed out for midterms, to the point where I found myself appreciating the cleverness of the code in the question where the code checked the parity of vowels in strings.
Sunday, November 9, 2008
Thursday, October 30, 2008
Program correctness
This week, the focus of you lectures have moved towards program correctness, which is more or less a formalization of proving that your code does what it should. I found this topic to actually be quite intuitive and something I had been doing in a much less rigorous and formal way in my head when planning my code. I also know have more of an appreciation for the somewhat draconionan rules we had for program style, most of which was directed towards making your code both readable and breaking it up into smaller parts. The idea of smaller blocks of code with helper function especially seems useful now since trying assess the correctness of a large block of text is far more daunting then the same code broken up into several parts. However, applying the proof methods we've learned to program correctness feels infinitely more tedious, with the attention to detail required being astronomically greater. I can't imagine how development teams would manage to be able to prove their code correct for a major project like an operating system. Unfortunately suspect that they don't, though I also suspect our computers would benefit greatly if the did.
Sunday, October 19, 2008
Recursion and Unwinding
Having seemingly finished induction for now, though it will inveitably come up again I'm sure, we've know moved the focus of our lecture towards recursions and time complexity. Recursion was initially a bit of an odd concept to me in programing class. While I didn't have any exceptional difficulty understanding it and it's usefulness, it always seemed much more natural to accomplish the same goal with a series of While loops. However, after enough practice, I began to become more use to the idea of using recursions consistently, if for nothing else because of how it seemed to form a far more elegant solution to most problems. However, after finding closed forms for recursively defined functions in lecture, recursion seems far less elegant. It is somewhat suprising how we define closed forms for recursive functions, as the methods in many ways are rather unintuitive.
After working on the weeks problem set, and getting stuck at a paticular step, I began to wonder how one would go about proving a closed form could not be found for a function. I would imagine that it's more likely that there are many functions for which we have not yet found the closed form for, rather then we know it is impossible to find a closed form and I for one believe the distinction is important. However, having tried to prove for myself that a function could not have a closed form, and, with Google yielding no useful results, I began to realize a certain failing in my knowledge of proving techniques. For most of the proofs we've done, i've had atleast some idea of the concepts and theorems behind what is necessary to provide insight into what we are proving. Yet, while proving that postage of 5 and 11 cents couldn't make postage of 19 seems black and white, proving that a function couldn't have a closed form is far less intuitive, almost to the point where it feels like i'm trying to prove a cat isn't a dog without knowing what a dog is.
Sunday, October 12, 2008
The first term test
In general, I have found most university tests and exams to be soul crushing affairs that, taken collectively over the span of the year, constitutes a suite of hostile, spiteful acts against the test taker and humanity itself. Thus, this year I resolved to stay at least a week ahead of all my assignments and tests where possible and afford my self as much time possible. Surprisingly, the spread of quantifiable difference it has made between courses affords an incredible range of results, some much more positive then others.
I am pleased with how the first test went and found it it to be both fair and meaningful assesment of our ability to demonstrate and apply the knowledge we've learned in the class and am glad to see that my studying and effort thus far have paid off, both in terms of my confidence with material and with my enthusiam towards the course.
Saturday, September 27, 2008
The benefit of weekly problem sets
With the start of second year, I have noticed many changes in the format of the assignments and weekly work in my csc courses. Having had to submit weekly problem sets for mat137y1 in first year and with the memory of the countless hours poured into the questionably difficult proofs, I was dreading the idea of having to do the same for csc236, csc207 and the required computational statistics. However, I was suprised to see the difference that keeping ontop of the weekly exercises for csc236 seemed to make in my ability to complete the first assignment. Ultimately, I think the reason I find the problem sets this year more useful then the ones from my math courses last year is because the difficulty is enough that I need to look over the notes i've made in class, but not so difficult that I become hopelessly lost and am forced to create a large study group to solve them. I found that the most useful aspect of these weekly problem sets are their ability to get me to review the material covered in class since, in first year, I found it incredibly difficult to do as the due dates and test dates of all the courses I had seemed to fall in the same week and left me with little time outside of working on them.
While the weekly assignments mean I have more work to do each week, it seems to lower the overall amount I need to revise before assignments and tests, since the concepts and materials have had a longer time to processed. Additionally I find it much easier to learn the concepts when the revision is done closer to when the exercise was done in class and because i'm not forced to recall a large number of distant concepts in one or two large chunks of time. Although my former first year self would be disgusted by the thought, this year i'm finding the problem sets this year to be extremely useful and effective tool towards learning the material, rather then a weekly chore.
Saturday, September 20, 2008
Beginning csc236
For the fall semester, we have just begun csc236, the follow up course to csc165. Having done csc165 in the fall semester of the previous year, I'm finding that my induction skills are a bit rusty. However, having taken a large number of math courses in the meantime, I'm finding myself able to remember the techniques of induction quiet quickly. I'm finding the problem sets to be a good way of keeping myself up to date with the material and am trying to keep at least a few days ahead of each of my due dates for all of my courses. Thus far, it seems to greatly reduce the stress of university life.
Subscribe to:
Posts (Atom)