So I'm doing some exercises with Turing machine and quite often it happens that a given set of states can be achieved if and only if some character was met. Therefore, we may have some states q3-q7 which the machine may be pointed to if and only if we spotted a and (because of the task spec, for example), we know that we may find only some chars (say b, d but not c, e) from the input language there so there's no need to have a separate state for every symbol. Can I then just program the states I'll actually use there and have some void states or do I have to put something there (like just reprinting the found character) anyway, even though I'm 100% sure the machine will never go to the state for some symbols?

  • 5
    $\begingroup$ It is perfectly reasonable not to write down transitions you won't use. You should probably ask your instructor though (assuming you have one). I don't think there are strong conventions about this as it matters very little. $\endgroup$ – Karolis Juodelė Jan 30 '13 at 17:32
  • $\begingroup$ I see. Thanks a lot :) And yeah, I do have an instructor but I'm afraid I won't be able to ask him before the exam so I'm just making sure ;) $\endgroup$ – Straightfw Jan 30 '13 at 17:37
  • 1
    $\begingroup$ @Straightfw, check the conventions used in your text's examples. $\endgroup$ – vonbrand Jan 30 '13 at 18:06

The output and transition functions have to be defined for all state and character combinations. But if you say you can't get into the state, it means that if you do get there, the input was invalid. Therefore simply append a definition like "and all transitions not mentioned so far are to a rejecting state" (which is an endless loop if you are doing a stop/don't stop machine).

  • $\begingroup$ I see. So I may as well put some "RS" in these states and then, when I'm defining the machine, state that F (final states) = {RS, AS} (Rejection State, Acceptance State), right? $\endgroup$ – Straightfw Feb 1 '13 at 16:55
  • $\begingroup$ @Straightfw: Yes. And you can make all the uninteresting transitions point to RS with single sentence, so you won't have to list them and they will still be defined. $\endgroup$ – Jan Hudec Feb 1 '13 at 20:04
  • $\begingroup$ You mean I could just leave the cells blank and state explicitly "All the empty cells point to RS" or is "statement" some TM-related keyword as well? Forgive me the foolish question, I'm a newbie and would like to refrain from stupid mistakes from the beginning :) $\endgroup$ – Straightfw Feb 2 '13 at 18:48
  • $\begingroup$ @Straightfw: That's exactly what I mean. $\endgroup$ – Jan Hudec Feb 3 '13 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.