Monday, November 10, 2008

Learning New Things...

As we studied program correctness last week, I learned quite a few new things. Amongst that was the fact that you can actually mathematically verify how smart a program is. Along with checking time complexity, through program correctness one can study loop invariants, come up with closed forms of recursion - all of this is applicable to regular programming concepts like binary sort or merge sort. Who knew!

We also began learning about formal languages. Now we are comparing the structure of language, the sets of alphabet. And the neat thing is being able to tie that in to programming: (from the lecture slides)
If x and y are strings, then we can talk about:
{ The length of x, jxj. So jj = 0
{ The concatenation of the characters of x and y, xy
{ The reversal of the characters of x, (x)R, so (string)R = gnirts
{ The kth power of string x:

Who knew?? This continues to teach me new things as I'd never in a million years imagined being able to analyze recursion or iterative loops in mathematical program correctness. Now I'm even more amazed at being able to analyze a set of letters! Who'd have known the alphabet could be mathematically studied?? It is taking a simple group of letters and applying set theory just as we study it mathematically. Neat. can't wait to learn more.

No comments: