0
2.4kviews
Design a DFA that rejects any string over {1,2,3} where 2 is immediately preceded by a 1. It should accept all other strings.
1 Answer
written 7.0 years ago by |
$\epsilon$-NFA for the problem is \ltcenter\gt![enter image description here][1]\lt/center\gt | S | {B,C} | {B.C} | {B.C} | |---|---------|--------|---------| | A | {B.C} | {B.C} | {B.C} | | B | {D} | $\Phi$ | $\Phi$ | | C | {D} | $\Phi$ | $\Phi$ | | D | {E,F,G} | $\Phi$ | {E,F,G} | | E | {G,H} | {G,H} | {G,H} | | F | {G,H} | {G,H} | {G,H} | | G | $\Phi$ | $\Phi$ | $\Phi$ | | H | $\Phi$ | $\Phi$ | $\Phi$ |
S:
A:
B:
C:
D:
E:
F:
G:
H:
NFA is given as
States\Inputs | 1 | 2 | 3 |
---|---|---|---|
S | {B,C} | {B,C} | {B,C} |
A | {B,C} | {B,C} | {B,C} |
B | {D} | {I} | {I} |
C | {D} | {I} | {I} |
D | {E,F,G} | {I} | {E,F,G} |
E | {G,H} | {G,H} | {G,H} |
F | {G,H} | {G,H} | {G,H} |
G | {I} | {I} | {I} |
H | {I} | {I} | {I} |
I | {I} | {I} | {I} |
Final DFA is