Sunday, November 18, 2012

Finite State Automata


We learned last week that we can draw/design/simulate computer programs and sequential logic circuits using FSM. The design is defined by a list of its states. We also learned that when you draw the FSM it starts at one point “current state” which can change to another state when initiated by a certain condition. Hence, Finite-State-Automata shows one state at a time.


In the example above, we can say if the starting state is q0 if we get z1 as input, then the state will change to q1. Or if the input is z0, then state will change to q3. If we’re on q1 and considered z1 as input then will keep the same state, or if input z0 then state will change to q2 and so on:
Current State                     Input                     Final State
q0                                           z1                            q1
q0                                           z0                            q3
q1                                           z1                            q1
q1                                           z0                            q2
q2                                           z1                            q3
q2                                           z0                            q0
q3                                           z1                            q0
q3                                           z0                            q3
                So far, I find the subject understandable and interesting  which will help me in my programming career. I still need to review the new definitions of "alphabet, string, and language" since they are new to me and would need to familiarize myself more with them.  

Saturday, November 10, 2012

Pre and Post-Conditions

     Last week we have learned about program correctness and how to prove precondition and post-condition after each iteration.

     I find this very helpful and would benefit us in the future, especially for those who will be programming, not for only a specific program language but any (python, java, C+) it is a general knowledge to know if the code you wrote should run or stop somewhere in the middle. But with these proofs you should know for sure if the program will continue on running or stop.

     Here is an example from my last year’s lecture that made it easier for me to understand pre and post conditions and how to prove them:

Upper and Lower Bounds


I’ve learned last week about upper and lower bounds on functions and how to proved them I liked how the prof used big Θ in out assignment since it is a combination of both big O and Ω, in which we have learned in class.I like how we play with numbers to make our function greater than or smaller than the given timing depending on c or b in which is easy to find at the end of our proofs .
I believe as long as we know these rules we're good to go:

Also I’m getting more and more confident with complete and mathematical induction since everything in this course almost depends on them both
Still need to get familiar with upper and lower bound proofs