简体   繁体   English

反转确定性有限自动机

[英]Reversing a Deterministic Finite Automata

I just started learning about automata theory in my computability and complexity course.我刚开始在我的可计算性和复杂性课程中学习自动机理论。 I was given an assignment that asks us to design DFA's based on certain conditions.我被分配了一项任务,要求我们根据某些条件设计 DFA。 However, one of my assignment questions is having us write a reverse DFA (assuming I understand the question correctly).但是,我的一个作业问题是让我们编写一个反向 DFA(假设我正确理解了这个问题)。 My professor did not give us any examples relating to reversing a DFA.我的教授没有给我们任何与撤销 DFA 相关的例子。 The question is as follows:问题如下:

For any w ∈ {a, b}∗, we write w^r for the reverse of w. For example, if w = ababbb, then w^r = bbbaba.

Show that {wxw^R | x ∈ {a, b}∗, w ∈ {a, b}^2} is regular by designing a DFA that accepts it.

Any advice/help as to how to solve this would be greatly appreciated任何有关如何解决此问题的建议/帮助将不胜感激

I won't do your homework for you, but here's a basic start.我不会为你做作业,但这是一个基本的开始。 Your machine accepts any string of four or more characters such that the first two characters are the reverse of the last two.您的机器接受四个或更多字符的任何字符串,前两个字符与后两个字符相反。

So your machine is going to go into any of four states based on whether the first two characters are 'aa', 'ab', 'ba', or 'bb.因此,您的机器将根据前两个字符是“aa”、“ab”、“ba”还是“bb”,将 go 转换为四种状态中的任何一种。

From the 'aa' state, you now have to accept [aa]*aa.从“aa”state 开始,您现在必须接受 [aa]*aa。 From the 'ab' state, you now have to accept [ab]*ba.从“ab”state 开始,您现在必须接受 [ab]*ba。 And likewise for the other two.另外两个也是如此。

You should be able to write a DFA that accepts these.您应该能够编写一个接受这些的 DFA。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM