120 likes | 136 Views
[Section 1.2]. Nondeterminism. Determinism: computation always continues in a uniquely determined way. Nondeterminism: have more (or none) choices Example: { w 2 {0,1} * | w contains 001 or 0101 as a substring }. [Section 1.2]. Nondeterminism.
E N D
[Section 1.2] Nondeterminism Determinism: computation always continues in a uniquely determined way. Nondeterminism: have more (or none) choices Example: { w 2 {0,1}* | w contains 001 or 0101 as a substring }
[Section 1.2] Nondeterminism Determinism: computation always continues in a uniquely determined way. Nondeterminism: have more (or none) choices Example: { w 2 {0,1}* | w contains 001 or 0101 as a substring } Nondeterministic FA can also use ε-transitions:
[Section 1.2] Nondeterminism Example: { w 2 {0,1}* | w contains 1 in the third position from the end } Does there exist a (deterministic) FA recognizing this language ?
[Section 1.2] Nondeterminism Example: { w 2 {0}* | |w| is divisible by 2 or 3 }
[Section 1.2] Nondeterminism • Formal definition: • A nondeterministic finite automaton (NFA) is a 5-tuple (Q,§,±,q0,F), where • Q is a finite set of states • § is a (finite) alphabet • ±: _____x_____ _____ is the transition function • q0 2 Q is the start state • F µ Q is the set of accept state
[Section 1.2] Nondeterminism Let N=(Q,§,±,q0,F) be an NFA and let w=w1w2…wn where each wi2§. Then N accepts w if
[Section 1.2] Equivalence of NFAs and DFAs • Thm 1.39: Every NFA has an equivalent DFA. • Proof idea: • for starters, no ε-transitions in the NFA • example:
[Section 1.2] Equivalence of NFAs and DFAs Thm 1.39: Every NFA has an equivalent DFA. Proof idea, part 2 (getting rid of ε-transitions in the NFA): - for R µ Q let: E(R) = { q 2 Q | q can be reached from R by traveling along 0 or more ε-arrows }
[Section 1.2] Equivalence of NFAs and DFAs Thm 1.39: Every NFA has an equivalent DFA. Proof idea, part 2 (getting rid of ε-transitions in the NFA): - for R µ Q let: E(R) = { q 2 Q | q can be reached from R by traveling along 0 or more ε-arrows }
[Section 1.2] Closure under regular operations Thm 1.45 (revisited): The class of regular languages is closed under the union operation.
[Section 1.2] Closure under regular operations Thm 1.47: The class of regular languages is closed under the concatenation operation.
[Section 1.2] Closure under regular operations Thm 1.49: The class of regular languages is closed under the star operation.