Reading through the assignment, question four seemed the hardest. I decided I would begin the assignment with question four. We had to create a DFSA that takes a binary string of odd length and that is a multiple of 5 when interpreted in base-2.
I looked through the lecture slides and the course notes for the required definitions of cardinality technique, DFSA, and the (Q, sigma, delta, start, finish) definition of a DFSA.
I looked over the problem and came to the conclusion that i will need to make two machines. One for the odd length and the other for the multiple of 5. I wondered where the cardinality property came in ?
I started sketching the two machines, with the accepting state, the empty state and all the transition states with their respective edges. The question says we have to create a single machine. I then began trying to join them up.
I started having problems in trying to incorporate the odd and even transition states for every state in the multiple of 5 machine, which ended up having 6 states. After a few hours of trying, I gave up in search for a better solution. I headed to the CS Help Center.
The T.A's at the help center were very helpful. They told me to look over the cardinality technique in the course notes. This techniques helps in combining two machines. Looking over the text I found out that the intersection of the machines gives a single machine. Such as, R = M/\M'. I was convinced this was the right way to do the question. I formally wrote out the definitions of both machines each with their respective transition states, start, finish, total list of states, language(sigma).
Now writing out the transition states for the resulting machine, I came up with 18 states. I had a feeling this was too much. I visited Prof. Heap, who told me my first machine that checked odd length was wrong. Not entirely wrong, just that it had one state extra. The even state was not needed as the empty state is of even length too. This reduces one state in the machine but 6 states in the resultant machine. This saved me a lot of work. The reason is because, the cardinality is using pairs of both machines. Thus I had 18 states first(6*3) but 12 later on (6*2).
I wrote out all the 12 transition states. Now all that is left is the state invariants. Again there were 12 of them. I asked Prof. Heap if I really did need to write them all out since it was monotonous in nature. He said it, is required just like a loop variant states what is true through the loop, similarly state invariants state what is true to reach that state.
Wednesday, November 19, 2008
Tuesday, November 4, 2008
Term Test
Finally all my midterms are done. I can spend some time on 236 now. I feel miserable not being able to attend lecture or reading up on any 236 for the last 2 weeks.
I can dedicate 2 days to the test. Its work 11% so I must do well. I'm gonna follow the same pattern of studying as the previous test. First, go through lecture notes. Second, the text book chapters and then practice tests.
I'm pretty optimistic about this test, since i did quite well on the previous one.
I can dedicate 2 days to the test. Its work 11% so I must do well. I'm gonna follow the same pattern of studying as the previous test. First, go through lecture notes. Second, the text book chapters and then practice tests.
I'm pretty optimistic about this test, since i did quite well on the previous one.
Subscribe to:
Comments (Atom)