I have tried to make a Post machine for that all words of the form $a^nb^n$ by the following steps.
- add a marker '#'
- read first 'a'
- read next 'a's and add them
- read first 'b'
- read next 'b's and add them
- read '#' (that we added in the first step)
repeat steps while input tape is not empty
but this algorithm also accepts words of the form $(ab)^n$ e.g abab, ababab I want to make a Post machine that only accepts words of the form $a^nb^n$ How to do that?
Asked By : user4129542
Answered By : n.Perception
Hint. One possible solution is checking the format of the input in the beginning of the procedure to get sure the user input is in form of $a^nb^n$. If it is in correct format then go to next step otherwise reject. In next step using the instructions that you've written can accept the language. But one thing which is important in post-turing machines is it's model (eg. Davis), which you didn't mention.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/37092
0 comments:
Post a Comment
Let us know your responses and feedback