The time has come to talk about problem solving. It is probably a weird time to talk about solving an exercise of the assignment after I have already submitted it, but I did not want to waste precious time writing this up while the clock was ticking before the deadline. Besides, I have a good memory and I can clearly remember the details of my thought process during those days. Actually, it would have been weird if I had forgotten those details, considering the time I spent on this question, the number of conversations I had with myself in my room, in the subway, while walking on campus etc.
I have chosen to talk about question 1, since it was the question of the assignment that I was stuck on for the most time probably and at the same time, the question I enjoyed the most.
This question is about proving that any DFSA that accepts L has at least 16 states, where L is the language of binary strings whose fourth-last bit is a 0.
I read the question many times and read the hint as well. I then wrote down the 16 binary string of length 4 and highlighted the ones that would be accepted by DFSA (the ones whose first bit is 0). In order for the DFSA to have at least 16 states, there must be some way to prove that each one of these 16 binary strings of length 4 would have to end up in a different state than the rest. But I had no idea why that made sense and surely no idea how to prove it.
My next thought was to construct a DFSA that accepts this language, since maybe that would help me see why at least 16 states are needed. It took a surprisingly long time to come up with a working DFSA for this purpose. When I finally got it, I counted the states I had and they were exactly 16.
My DFSA looked like a binary tree. On the very top, was the starting state, with a self transition of 1s. This starting "node" had one child only, to which one could be lead to with a 0. That "node" of the DFSA (the child of the starting state) is the root of the binary tree. It has two children: one could get to the first one with a 0 and to the second one with a 1. Each of those children has another two children that can be reached in the same way and each one of those has another two children. Those final children are the "leaves" and each one of them is an accepting state of the DFSA. From the leaves, there are transitions back to the very top in some cases, or back to the root of the tree in other cases, or to the father of grandfather of the leaf in other cases, or even to other leaves sometimes.
I then tested my machine with the 16 binary strings of length 4 and indeed, each one ended up in a different state. Among those 16 binary strings of length 4, there are 8 strings that are accepted by L and 8 that are not accepted by L (since exactly half of them start with a 0 i.e. exactly have of them have 0 as their fourth-last bit). The ones that are accepted by L ended up in one of the leaves - there are exactly 8 leaves in the DFSA that I described above, one for each of those 8 accepted strings. The ones that are not accepted by L, on the other hand, never made it to the leaves, since the self transition in the starting state happened at least once and so there were at most 3 bits left after that, which are not enough to drive the DFSA to the leaves.
At this point, it made sense to me why each binary string would end up in a different state, but I still had no idea about how this can be proven.
In the following post, I will record my thought process that lead me to the proof.
No comments:
Post a Comment