什么是(0 + 1)*的DFA?

问题描述 投票:0回答:2

我在下面绘制了这个图表。但我想确定答案为+和*运算符令人困惑。

     _  
    | \
--> q_|- 0,1,E

在这里,我的DFA只有一个州q。 0,1,空都被重定向到q本身。

computation-theory
2个回答
1
投票

(0 + 1)表示您可以选择0或1,但不能同时选择两者。 +类似于OR。明星意味着您可以进行零次或多次此选择。

因此,(0 + 1)*将包括0和1的任何字符串,包括空字符串。


0
投票

迟了5年但是我得到的是:

Start at A. A is also an end state.

From A: Input 0 goes to B. B is an end state.
        Input 1 goes to C. C is an end state.

From B: Input 0 goes to B.
        Input 1 goes to C.

From C: Input 0 goes to B.
        Input 1 goes to C.

我很确定这是对的(为考试而学习)...

可能很难从中看到,但如果你从我的指示中绘制图表,它应该更清楚。

希望这可以帮助任何人看这个。

© www.soinside.com 2019 - 2024. All rights reserved.