Monday, December 3, 2012

The last quiz

 I did really bad for the last quiz today, tried so hard to figure out how to devise a DFSA that accepts strings with length which has a reminder of 2 if divided by 3.
 The question gives examples like 2, 5, 8, I can come up with 11 and so on, so a string is accepted as long as it's 3 units longer than the previous one. And empty string is clearly not accepted, in this case, the starting state can not be an accepting state, then whichever way to get to the accepting state needs at least two states, one of which is the accepting state. I just figured out I'm still don't fully understand what a DFSA is (I thought I understand it before this quiz, just a reminder, the key idea of DFSA is : every single state has exactly one transition for each possible input)
  So my actual solution is quiet simple like this:


  In this case, it totally works, and the RegEx for this DFSA is : (1+0)^2((1+0)^3)^* , I was so stupid during the quiz cuz I thought the question might be like devise a DFSA that accepts odd 0s and even 1s, which is similar to the tutorial question(Since this is how the previous quizzes work)
  Anyway, this quiz reminds me that I need to go through all those basic concepts during reviews.

No comments:

Post a Comment