DFA of two simple languages and then product const

2019-08-17 04:27发布

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?

标签: dfa
1条回答
女痞
2楼-- · 2019-08-17 04:59

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

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.

查看更多
登录 后发表回答