DFA of two simple languages and then product construction of those two languages

ぐ巨炮叔叔 提交于 2019-12-13 04:16:26

问题


The language below is the intersection of two simpler languages. First, identify the simpler languages and give the state diagrams of the DFAs that recognize them. Then, use the product construction to build a DFA that recognizes the language specified below; give its state diagram before and after simplification if there are any unneeded states or states that can be combined.

Language: {w is a member of {0,1}* | w contains an odd number of 0s and the sum of its 0s and 1s is equal to 1}

This is my proposed solution: https://imgur.com/a/lh5Hwfr Should the bottom two states be connected with 0s?

Also, what would be the DFA if it was OR instead of AND?


回答1:


Here's a drawing I hope will help understand how to do this:

Language A is "odd number of zeros". States are labeled Z0 and Z1 indicating even or odd number of zeros.

Language B is "exactly one one" (which is equivalent to "sum of digits equals one"). States are labeled I0, I1 and I2 indicaing zero, one or more ones.

Language A+B can be interpreted as A∩B (ignoring the dotted circles) or AUB (counting the dotted circles). If building A∩B, states Z0I2 and Z1I2 can be joined together.

I hope this gives not only an answer to the exact problem in the question, but also an idea how to build similar answers for similar problems.



来源:https://stackoverflow.com/questions/54442775/dfa-of-two-simple-languages-and-then-product-construction-of-those-two-languages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!