Tuesday, 27 November 2012

The (late) weekly post: Nov 27, 2012

It appears that I'm a week or two behind on this weekly post I had been attempting to keep, so hopefully this makes up for it....

We got back our second term tests and I was happy to see that I got perfect on it! I was a bit nervous due to the fact that I hadn't studied pre and post conditions and correctness of a program but I managed to pull through. The second question I was more confident about, since it was just using the Master Theorem to find the time complexity of the given program, and rewriting the code so that the time complexity changed.

Unfortunately my second assignment mark wasn't nearly as great as my term test. I had gotten the first question mostly wrong and since the assignment was only two questions... well you can see where this is going. I found the first question quite difficult but I had felt I made some progress on it. Looking at the marking it seems that my unwinding led me to the wrong closed form; I had written down that H(n) was just the closed form of the Fibonacci sequence, but it was actually that + 1. I probably should have double checked my work but I left it to the last minute to do so I had no time. The second question was about proving the time complexity of some recursive function, which wasn't too hard since for one part of the question we were just told to emulate the course notes proof with some minor changes to fit the question. To prove that the function was in the big Theta, I just showed that the function was in Big-O and Big-Omega. In the end I had chosen the wrong constant (it was also off by + 1) but the proof was fine.

In lectures we learned about languages and alphabets and how different languages are combined with others to form a whole bunch of strings. At first I didn't know what was going on but after the tutorial it seemed pretty easy, it just gets a bit confusing with being bombarded with new terms and notations on how to define a language and such. In the other lecture we learned about regular expressions and how languages were defined with those. The professor then proceeded to showing us finite-state automata which basically shows us whether or not a string is inside a specific language. These automata seemed fairly simple until he showed us the non-deterministic one, where the same character can lead to different states, which I found pretty weird.

Our third assignment has been posted but unfortunately I've been caught up in a presentation I'm supposed to be doing tomorrow, hopefully after I'll be able to work on that, my AST221 problem set and also my CSC207 assignment which I haven't started either... once again it's going to be another hectic few days for me as I try to blast through all of my homework... I also have to finish the mathematical proof post for this blog also, which is due next week. Hopefully I'll be able to make it through these last two weeks of classes before exams, wish me luck!


Monday, 12 November 2012

The weekly post: Nov 12, 2012

Last week in 236 was the dreaded test week... I had kept telling myself to study early on so that I wouldn't be overcome with it at the last minute, but as usual I put off studying to do other things. By the night before I barely studied anything that was potentially going to be on the test, so I just redid some of the tutorial questions. I only managed to get through two tutorials and a bit of the textbook before I went to sleep. A funny thing is that I had convinced myself that pre and post condition weren't going to be on the test... but I was wrong. When I got the test the first question was about pre and post condition, and the second was about using the Master Theorem (which isn't too hard), so I finished the second question within five or ten minutes and dedicated the rest of my time to figuring out the first question.

For the first question, it was about a recursive function that takes two parameters x and y, and returns the value of x^y. All I really knew about the first question was that the precondition has to lead to termination and the postcondition, so I used complete induction to show that the precondition led to termination when y was 0, 1, and an even or odd number. I personally didn't think the first question was going to go well but by the time I finished my proof it seemed pretty solid. Obviously since I didn't actually study the pre and post condition I may have left out some details but overall it wasn't so bad.

After that I left lecture early just because 236 was my last test for the whole period of midterms I was having and I felt like I needed to take a break. I'm pretty excited to see how my test turned out, since I went into with the preparing for the worst but came out of it pretty confident in myself.

Sunday, 4 November 2012

The weekly post: Nov 4, 2012

It seems that I'm starting to slack off a bit in this class, which is definitely not good... but I have been caught up with my other classes terribly; I have a calculus test tomorrow and I've also been slacking off in that course, along with that I need to research my topic for a presentation in my astronomy class in a few weeks that I haven't started yet. I also have a group assignment in CSC207 and the first part of that assignment we didn't do too well on. In other words my procrastination is showing its true colours.

For this week's lecture, we analysed the recursive binary search function and talked about its precondition and postcondition. We were also showed how the precondition leads to the postcondition and the code's eventual termination using induction. Afterwards we looked at merge-sort once again and analysed it's pre- and postcondition. I would be lying if I said I wasn't confused, but that usually happens when I go to lecture anyways; I think it's due to a mix of the professor going a bit fast and my own preconceived thoughts of the difficulty of the material - I thought that since I already did pre- and post- condition in CSC165 that this wouldn't be hard to grasp, but this course goes more in-depth than what I had previously learned.

In my tutorial, I sat up in the front this time and I must say, there was a huge difference from sitting at the farther region of the room. At the back I could barely see what was on the board and the TA's voice did not reach down there, but at the front the chalk was finally visible and the TA's voice was somewhat clearer (my TA isn't very loud in the first place). I'm a bit uneasy with the quiz however, since I had gotten a suspicious answer... but we'll just have to wait for the results!