Friday, November 28, 2008

Context Free Grammars

I find the entire concept interesting to say the least. There is actually a set of rules for a language that can denote a sandwich. I plan to head to subway with a large index card printed with rules on the front and point to it as I order. But the guy behind the counter could create some kind of infinite sandwich which will end up costing me a pretty penny.

Anyways, I did notice that the example with "a mat beside the dog and a cat saw the mat" was... was close enough to a perfect sentence. BUT, It does get really close to that lolspeak crap that everyone on the internet uses these days.

A simple example: Internets, Intarnets, Interweb, Intarweb, lol internet etc.

S-> CABC
A -> Inter | Intar | Inner
B -> web | net | webs | nets | tube | tubes
C -> lol | ""

Oh man, now I feel retarded. I was about to post a more complex example but my IQ dropped dangerously into the zone reserved for Microsoft Fanboys and /b/tards.

Anyways, another thought. If you had a room full of monkeys and Context free Grammars, eventually they would produce the works of shakespeare.


edit: also waiting for approval to submit A3 related posts I have stored up.
edit2: looking at what I wrote a couple of days later, I realize I may have done something wrong.

Wednesday, November 19, 2008

Regular Expressions

I am finding this section of the course to be the most satisfying. I find RE's are a material I can grasp a little easier and thus am enjoying writing the problem sets. I even looked over the assignment and it seems to be easier than A2 or A1. Normally when I begin an assignment, I print it out and mark in red my thoughts and ideas before seriously attacking the problems. A3 is a sea of red to my eyes.

Or it could be that I received my A2 mark and it was decent, boosting my morale. Or the fact that I somehow managed to get a perfect score on a problem set for once, a pretty decent achievement for someone with a logic deficiency.

Lately I've been trying to develop applications for the iPhone platform. A regular expression checker came to mind. Then the entire idea of writing software specifically for UofT students came next. Software to aid csc students. I like where this is going. There's no better way to understand the material I'm being taught than through application.

Or maybe I'm dreaming too hard.

Friday, November 7, 2008

Epic Fail.

Well, Assignment 2 and Midterm 2 have come and gone. Overall, I found them both fair.

...Although I should have spotted earlier that one of the functions in question one was the Fibonacci sequence. I remembered as I was doing question 2, but somehow forgot it by the time I got to question three. Note to self: write all epiphanies down immediately.

Knowing that it was a fibonacci could have made it easier to prove. Instead I wrote T(n) down on the leftside and 2F(n+1) -1 on the rightside and tried to unwind them both. I know I'm doing something wrong there. Perhaps I still don't understand the final goal, I need to do more proofs as practice. Me attempting to unwind (always a slow process to me) took the majority of the test and I stupidly didn't leave enough time for the other questions. Perhaps just enough time, I did finish them, but that doesn't mean they're correct. I know I can do it (I managed to do it on Assignment 2). Speed is my major issue. I will work on that for Test 3 and the final.