110 likes | 473 Views
Nondeterminism – Introduction. Lecture 8 Section 1.2 Fri, Sep 7, 2007. Determinism. A finite automaton is deterministic because every move is forced. That is, is a function . For every pair ( q , x ) Q , there is exactly one q Q such that ( q , x ) = q.
E N D
Nondeterminism – Introduction Lecture 8 Section 1.2 Fri, Sep 7, 2007
Determinism • A finite automaton is deterministic because every move is forced. • That is, is a function. • For every pair (q, x) Q, there is exactly oneqQ such that (q, x) = q.
Nondeterminism • To make a nondeterministicfinite automaton, we relax the requirement that the image of (q, x) be unique. • (q, x) may have no image, one image, or more than one image. • We also allow moves.
Terminology • Deterministic finite automata are called DFAs. • Nondeterministic finite automata are called NFAs.
The Language of an NFA • For a given input, an NFA may admit a multitude of computations. • If at least one computation ends in an accept state, then the input is accepted.
Concatenation • Let A = {x | x contains an even number of a’s}. • Let B = {x | x contains an even number of b’s}. • Design NFAs that accept • AB • A B • A*
Definition of an NFA • To define an NFA, we change the definition of the transition function .
Relations and Functions • Given a relation from a set A to a set B, we may derive • A function from A to (B), or • A function from (A) to (B).
Example • Let A = {2, 3, 4, 5}. • Let B = {6, 7, 8, 9}. • Let r be the relation defined by (a, b) r if a divides b. • Then r = {(2, 6), (2, 8), (3, 6), (3, 9), (4, 8)}.
Example • Define f : A(B) by f(a) = {bB | a divides b}. • Then • f(2) = {6, 8} • f(3) = {6, 9} • f(4) = {8} • f(5) =
Example • Define g : (A) (B) by g(S) = {bB | a divides b for some aS} • Then, for example, • g({2}) = {6, 8} • g({2, 3}) = {6, 8, 9} • What is g()? g({4, 5})?