Frage

I have drawn this diagram below. But i want to be sure of the answer as + and the * operator are confusing.

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

Here my DFA has only one state q. Both 0,1,empty are redirected to q itself.

War es hilfreich?

Lösung

(0+1) means you can select a 0 or 1 but not both. The + is analogous to OR. The star means that you can do this selection Zero or more times.

Hence, (0+1)* will include any String of 0s and 1s including the empty string.

Andere Tipps

5 years late but heres what I got:

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.

I'm pretty sure this is right (studying for an exam atm)...

It may be hard to visualise from that but if you draw a diagram from my instructions it should be more clear.

Hope this helps anyone looking this up.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top