Wow, I can't believe the semester is nearly over! As of this morning, I have officially finished my last class of the semester. All I have left is one assignment due tonight, an essay, and exams. Speaking of class this morning, the test was not hard, but I wouldn't say it was easy either. I had some trouble with the question about the set of regular expressions that didn't have the concatenation property. Oh well, I guess I will have to do well on the final exam to make up for this (and previous tests/assignments.. :P). I was really hoping for a question to ask us to design and construct a DFSA rather than this proof question that I didn't get in the end :(


Anyway, this entry will be about the last two weeks of CSC236. Assignment 3 was easier for me to do than previous assignments. That's probably because I like and find this material easier than what we've done in the past. I hope we get our grades soon. 

We learned the pumping lemma and proving non-regular languages last Monday, and then looked at context-free grammar the rest of last week and finished it up this Monday. Wednesday was a semi-review lecture, and then today was the test. Although context free grammar is new to me, I found it to be quite interesting or at least, the part where we follow the letters and build languages. Proving that a context free grammar is actually equivalent to a language wasn't as appealing. I'll definitely have to review that for the exam. Something else that was completely new was the new machine with a "stack" that we developed for representing non-regular languages. I remember understanding it during lecture, but as I look at my notes now, I'm having trouble deciphering my notes.  I'll need to review this too. 

Again, I tried to review the course notes for my test today, but it just didn't work for me. To be honest, I've hardly actually reviewed the book for this course. I find what Prof. Heap teaches to be a lot easier to understand than a lot of the material in the book. Sometimes when I don't understand something I wrote down for lecture, I consult the course notes. Sometimes it helps, but most of the time, I get even more confused by it. Oh well, according to Prof. Heap's review method, the course notes aren't even on the top 4 things to review. That's good, I guess :D

Anyway, although this course wasn't a favourite, it was an overall pretty good experience. A little too much induction for my liking, but at least with induction, you can always get partial marks for writing just the outline. Now there's only the exam left to look forward to....

Thanks to Prof. Heap for a great semester :) Good luck to everyone on their exams!

Week 11

Well, answering my last question, we looked at how to prove a DFSA this week. It was a lot more straightforward than I thought. Everything was pretty much definition based, for which I am glad. Then things started getting a bit weirder. We began looking at NFSA's and how every regular expression has an FSA. And then how every NFSA can be rewritten as a DFSA. I could follow the pictures Prof. Heap drew, but I had a hard time trying to picture how to apply it to concrete examples. And then finally we learned the cartesian product so that we can build DFSAs for accepting strings with two different properties. Working through the last example at the end of Wednesday's lecture helped reinforce how it worked. I went home and filled in what we started in class. Building a machine that was a union of two different machines was surprisingly a lot easier than I had imagined.


On Friday, we looked at how to take an FSA to get a regular expression. It took me a little bit of time to spot everything I needed to restore when RIPping out a state, so I tried out a couple more of FSA -> regex problems when I got home. The resulting regular expression always seem to be really long and ugly, especially when the machine you start with has a lot of states. Can it be simplified?

The last problem set was also due this week. It gave us some more practice with equivalent languages. I think I'm still having a bit of trouble with the proof, especially going from a language described by words to a language denoted by a regular expression. I need more practice (as always) >_<

Week 10

Continuing formal languages, we looked at equivalent regular expressions and then finite state automata. Again, I've looked at finite state machines before while studying regular expressions last year so what Prof. Heap was describing in class was very straightforward. The only new part would be describing and essentially "drawing" the machine in words. Once it's explained, it's pretty easy to write out and understand though. I find it the easiest to draw first and then put it into words and definitions. I wonder how we're going prove that these DFSA's actually represent the regular expression?

Week 9

So I finally decided to try printing out slides for once, and as expected, it beats copying down notes by a landslide. 


Anyway, we started looking at formal languages this week. I've worked with regular expressions before, so I had no trouble understanding a lot of it. But the way we're approaching it is definitely much more formal than I've ever seen. Other than that, I think this is a nice change from what we've been doing before, even though we're still using induction. Maybe it's just me, but I find this material easier to digest than some previous material we've looked at.

Term Test 2...

Midterms always turn out to be better than I had thought. Maybe with the exception of Stats...


Anyway, this term test went pretty well, I guess (for the amount of studying I had done). I'm pretty sure I got 2 out of the 3 questions perfect. I had some trouble with the question about proving the termination of a loop. Again, what stumped me was the loop invariant (which I wasn't sure that we even needed). I came up with ni = (ni-1+3) / 5, but I had some trouble proving it. Then I got stuck in proving that if there were i+1 iterations, the loop would terminate. I needed to show that ni+1 < ni somehow, but again, the algebra just didn't click for me because I was starting to panic and run out of time. Oh well, this proves that I need to review iterative correctness some more. 

As I was studying for this term test actually, I found the course notes really difficult to read and ultimately, understand. Although the problems done by Prof. Heap are similar, I find his notes much easier to understand than the notes. The notes just seem to have too many words and seem to go on and on. I ended up reading bits of the course notes and referring to Prof. Heap's notes to understand what they were doing rather than vice versa. Hehe.. Maybe this is just me :P

Week Eight

Iterative program correctness requires a bit more work than recursive correctness. Although a bit trickier, I still prefer this over recurrences and time complexity. The lectures this week were pretty interesting. I am finding myself having trouble determining loop invariants, however. I tried reading the book, and even it says that determining these things just requires practice and thinking. There is no mechanical way of finding it unfortunately :( Also, I am not looking forward to proving iterative correctness on tests. After the double loop example we did in class, I can easily see myself rushing to write out a proof as there are so many steps. Hmm. I can't believe everything we've been doing so far involves induction. I knew we were going to work with induction, but I didn't realize that pretty much our entire course is based on it. 


Anyway, I am still trying to let this material settle in. Some more practice problems with proving loops would be great. I was actually hoping there would be a problem set question dealing with iterative program correctness, but we have a test instead. In fact, I can probably expect an iterative correctness question on the test. Well, I guess it's up to me to force myself to do or at least look at some problems... I seriously need more self-control =_=

I decided to work with a partner for A2. For me personally, I think I should have worked on it alone. Although we discussed together how to approach and do the problems, we ended up finishing 2 problems each to save time. This was a real disadvantage because I didn't get to practice writing up half the problems. A2 went alright in the end. It was pretty much a recap of everything we've done so far. We were stuck on Q1 for the longest time, however. I drew A LOT of ternary trees. Haha.. oh well. We got (most of) it in the end. Because we were focussing on Q1 for so long, we overlooked and didn't check our answers for the rest of the questions, and that's where we lost the rest of our marks.

Week 7

Unfortunately, I missed the Monday lecture with the guest lecturer because I was frantically studying for another midterm. Anyway, we looked at program correctness this week. I think compared to the material we were covering the last couple of weeks, I find this a lot easier to take in and understand. There is something about time complexity that I just despise. Program correctness, on the other hand, feels more straightforward. I just need to follow the code and check if the postcondition is satisfied or not given the precondition. 


Thus, I found the problem set for this week pretty easy. I think problem sets are normally quite easy though. Assignment questions, however, are much harder. I also think weekly problem sets are a great way to force lazy people (like myself) to practice and do problems related to the course material recently taught. It makes me feel less behind than I would've been :P

x_x

It has been a very stressful and busy midterm period. Although it's still not quite over yet for me, I am going to take some time and try to catch up on my slogging.

As I've mentioned before, I missed Week 5's lectures, and I am still having trouble understanding how to deal with closed form expressions. I had no trouble with Problem Set 3, but the notes on developing a closed form expression for the Fibonacci function haven't exactly 'clicked' for me. Perhaps the midterm stress is the cause, but I do have to admit that I haven't really sat down and investigated it thoroughly.

We looked at the complexity of merge-sort and the Mast Theorem last week. I really need to print out the slides and write on them instead. There were many slides of just text last week, and I tried to write them all down. In the end, I had "see slides online" written after trying to copy everything down, and I didn't get to hear anything Prof. Heap said as I was too busy writing. It's probably better that I print the notes, read them before lecture, and then just follow along the lecture. It's so simple, yet I feel that I need to continue writing up my notes since that is how all my notes for this class have been so far. Anyway, we proved that the time complexity of merge-sort was nlogn. We actually took the code and came up with a time complexity of which we proved by building on several smaller proofs. Or.. I think that's what we did. To be honest, I am somewhat lost at the moment in the course. As things die down, I think I will be able to make sense of everything again. Hopefully.

Well, besides catching up on the course, there's also another problem set and assignment due next Monday. I've looked at the problem set, and it should be somewhat similar to what we did in Wednesday's lecture. I'm having a bit of trouble wording what I want to say though. In fact, throughout this course, I seem to have some problems with the way I present anything. I'm going to have to work on that. The assignment.. won't be too bad, I hope.

As I was super busy lately, I've totally neglected my blog for a while. So, I'll pick up where I left off.... week 4!

We started looking at more recursive functions and definitions, and we started discussing some proofs involving them. We were introduced to Fibonacci. I was very surprised by how many different places it shows up. We also had some practice identifying recursive definitions. I thought the third example was very interesting. It was as follows

f(n): 
= 0,  if n = 0
= f(n+1) - 3n2,  if n > 0

During class, I thought that this was not a properly defined recursive function because f(n) always depends on its next element, which we'll never get since it depends on the element after that. I had no idea that it could work until Prof. Heap showed us that it could be rewritten.

We also started looking at time complexity of code again, especially of recursive code. We did some of this in CSC165 last year, but I've almost completely forgotten how to deal with it. It was a bit tough at first trying to calculate complexity.  Since we didn't have time to prove the time complexity of something, I've forgotten how to do that too. I'll need to find time to sit down and try to do a problem.

I missed some class last week, so I'll need to get all the notes and read everything over before I write about week 5. The test, I'll just write about briefly now.

The test on Friday wasn't as bad as I had expected it to be. I had a lot of stuff to do, and I ended up only studying the day before, so I was pretty worried. Then again, as I've said last year, it's hard to study for tests involving proofs. Either you get it, or you don't. Anyway, unfortunately for me, I didn't get to finish the entire test. I realized the answer 30 seconds before time was up. I started scribbling and I actually had part of key step on paper, but I didn't get to finish writing up my proof formally. The lack of practice and studying probably made me think a bit slower than I should have. It was an overall disappointing test, but I'll use it to remind myself to study harder for the next test.

Anyway, I hope everyone had a great Thanksgiving weekend. Let the midterms continue...

A1

I didn't know whether to put this under Week Three or Week Four, but anyway, I finished assignment 1 yesterday, a few hours before it was due. It wasn't all that bad in the end.. but I did have a lot of trouble starting the assignment and figuring out exactly what I needed to do. Question 2 really stumped me because I thought we actually had to prove that our technique works using induction. Instead, the TA told me just to use it to come up with a solution for n+1 meals. I sincerely hope that was what Prof. Heap wanted, otherwise I would have messed up a whole question. 


Anyway, I don't know what more to say about it. I started the actual writing of the assignment pretty much on Sunday, which was not such a great idea. The assignment was definitely tricky because I was afraid I wouldn't be able to finish it. Somehow, I managed to pull through. Hopefully I've learned my lesson and will start the next assignment early. On a totally different note, TA's are very helpful when you're stuck. I'm so glad there are so many office hours since I can't make more than half of them.

I'm still working on the assignment.. so I'm going to have to keep this entry short. 


Firstly, problem set 2 was nice and simple, in my opinion. The first part was very similar to what we had done in class. Compared to the simple induction method we saw last year in 165, this one was very different, yet it still made so much sense. I would have never thought up this sort of solution on my own though. I just used logic to explain the second part. Hopefully what I did was alright.

We looked at how the Principle of Well-ordering and the two different types of induction were equivalent this week. I understand some parts, but not all of it yet. The example in the book didn't seem to help me either. I'll take a look at it after the assignment. We also dealt with simple induction with bases that were larger than 0 and examples of improper proofs. I had no trouble with bases greater than 0, but I did have a little bit of trouble spotting some of the errors in the proofs we looked at on Friday, particularly the hexagon one.

In any case, I was more comfortable with this week's material than the last. I guess I'm still a bit edgy with complete induction. I'll do more practice after the assignment, which I am quite a bit behind on at the moment. Sorry for any incoherences as I am rushing through this entry so I can continue working on A1.

Post numero 2!

So, the third week of classes are beginning already, yet I still feel an extreme lack of motivation and concentration. I know I should start focussing before I fall behind, but I'm constantly feeling tired from my super spread out schedule, 3 night classes, cooking, cleaning, and my part-time job. I need to work out some sort of schedule to be better organized :S


I started and finished my first problem set on thursday. Luckily, it wasn't difficult. The first problem was very similar to what we had done in class. The second one required more thinking, but was just as straightforward. The solution I wrote up seemed like a "dumbed down" version of the solution posted today. The one posted seemed much more mathematical and precise than my own. I hope we aren't graded too roughly on how we decide to present our solutions. Like, would it make any difference if I were to say "1 is either 1, 2, or 3" rather than "1 is in the set {1, 2, 3}?

Anyway, so we looked at another flavor of induction last week: complete induction. I don't really like complete induction. Sometimes it just takes me a while to work out what I need to do in order to complete my proof, and that's really frustrating. For example, the examples we did in class - although I saw what the patterns were or what the recursive factor was, I just couldn't put it into words. When Prof. Heap asked the class to scribble down ideas, I just didn't know what to write down sometimes. Perhaps I'm just one of those people that need more time to think about something. Whatever it is, it was still pretty frustrating. I still haven't found time to read the course notes yet. I read on someone's blog that after reading the book, induction made more sense to them? I don't know if it will help me solve more problems, but I should read up in any case. 

On a completely different note, I really like how Prof. Heap is using his tablet PC to present his lectures with, but there are a couple of concerns I'd like to address. Firstly, I don't print the blank slides (perhaps I should), and I find that sometimes, usually at the end of a slide, the slides change too quickly and I don't catch what was written last. Luckily, the slides are posted online, so I can find what I had missed. Secondly, sometimes when the Prof is trying to emphasize a point, he scrolls his cursor around the word or point. The cursor is actually kind of hard to notice because it's a tiny green dot that sometimes blends with the words themselves. Usually, I am able to catch it while it's making its loops, but I'd just like to point out that its not always easy to see. 

That's enough blogging for me tonight, I think. I've got a looooong day ahead of me tomorrow.

CSC236... Begins!

School has finally started again. It feels like only yesterday that I was still in first year...  except my memory seems to tell me otherwise; I've failed to retain anything after my brain turned off for four whole months. I guess what I meant to say was, summer sure went by quickly. I hope everyone has enjoyed their summer. I know I did. :)


So after last semester of SLoG writing for CSC165, I find myself SLoG writing, not surprisingly, for CSC236 this semester. Although I am not a big fan of recording and reflecting about a particular course, I suppose this will force myself into reviewing problems that I didn't understand in class and into solving problems Prof. Heap gives us to think about. 

We focussed on simple induction for the first week of classes. Although I can follow what is being explained, I find that I am having a bit of trouble coming up with the "key" step on my own. I guess I just need a bit of time for my brain to pick up the pace again. Other than that.. I think classes are pretty straightforward and going at a good pace. We've gotten rid of the very rigid structure of presenting our proofs from CSC165 and replaced it with something more flexible. I think there are good and bad things about this. Firstly, it is great to know that we can write up our proofs without having to worry about indenting and formatting. The proof can also flow better; however, this also means that half the marks we got last year for just the structure is not as easily attainable. It is also easier to miss crucial components to your proof while writing in paragraph form because you can't just spot it like you would in the 165 structure. 

Anyway, I hope this class will turn out as interesting as CSC165, if not more. I am not really enjoying CSC236, but I definitely do not feel as much hate as I did at the beginning of CSC165. I should probably get started on my problem set as well as some reading for this course now.