Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[征集题目] 设计能够识别3的倍数的自动机 #21

Open
2 tasks done
Michael1015198808 opened this issue Sep 17, 2019 · 0 comments
Open
2 tasks done

[征集题目] 设计能够识别3的倍数的自动机 #21

Michael1015198808 opened this issue Sep 17, 2019 · 0 comments
Assignees
Labels
problem-collecting collecting problems

Comments

@Michael1015198808
Copy link

Michael1015198808 commented Sep 17, 2019

主题:
自动机

题目:
写一个DFA,使得其能识别二进制数字中3的倍数
(假定输入顺序是高位到低位)
(这个假定会让问题比较简单,但是低位到高位也能解决)

习题 还是 OT (在[]中填入x表示勾选):

  • 习题
  • OT

推荐理由:
将自动机中的“状态”与某些可以解释的东西联系在一起,增加对状态机的理解

题解:
状态机有3个状态,记作012.
状态i表示目前为止读到的数字串对应的二进制数字模3的余数。
那么状态转移就一目了然了
状态i接受输入j后,会转移到(2i+j)模3

状态 输入0 输入1
0 0 1
1 2 0
2 1 2

参考资料:
UCB程序设计语言及编译器(CS164)课程作业1

其它:

@Michael1015198808 Michael1015198808 added the problem-collecting collecting problems label Sep 17, 2019
@hengxin hengxin changed the title [征集题目]+题目关键词 [征集题目] 设计能够识别3的倍数的自动机 Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem-collecting collecting problems
Projects
None yet
Development

No branches or pull requests

2 participants