Loading in 5 sec....

Deterministic Finite AutomatonPowerPoint Presentation

Deterministic Finite Automaton

- 87 Views
- Uploaded on
- Presentation posted in: General

Deterministic Finite Automaton

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

- A deterministic finite automaton (DFA) is a five-tuple A = (Q, , , q0, F) where
- Q is a finite set of states
- is a finite set of input symbols
- is a function : Q Q called transition function
- q0 Q is called the start state
- F Q is called the set of accepting states

- Transition diagram for a DFA is graph defined as follows:
- For each state there is a node labeled by the state
- If (q, a) = p, then there is an arc from q to p labeled by a
- There is an arrow into the start state q0 labeled start, The arrow does not originate at any node
- Nodes corresponding to accepting states marked by double circles

- A transition table is a tabular representation of the transition function. Rows of the table correspond to states and columns correspond to input symbols. The entry if the cell indexed by state q and input a is (q, a). The start state is marked with an arrow, the final states are marked with *.

0,1

0

1

1

0

q2

q0

q1

- Transition function on strings:
Let w=xa

1)

2)

- A DFA accepts a string w if is a final state
- The set of all strings accepted by a DFA, A, is the language of the DFA denoted by L(A). The DFA A is said to accept/define a language L if L(A) = L

1

q1

q0

1

0

0

0

0

1

q2

q3

1

- A nondeterministic finite automaton (DFA) is a five-tuple A = (Q, , , q0, F) where
- Q is a finite set of states
- is a finite set of input symbols
- is a function : Q 2Q called transition function
- q0 Q is called the start state
- F Q is called the set of accepting states

- Extended transition function:
- The language of an NFA A = (Q, , , q0, F):

0,1

start

q0

q1

q2

0

1

- Subset construction:
Let N = (QN,, N, q0, FN) be an NFA, construct a DFA

D = (QD, , D, {q0 }, FD ) as follows:

- QD is the set of all subsets of QN
- FD is the set of subsets S of QN whose intersection with FN is not empty
- For each set S QN and each input symbol a

- Theorem: If D = (QD, , D, {q0 }, FD ) is the DFA constructed from the NFA N = (QN,, N, q0, FN) by the subset construction, then L(D) = L(N)
- Theorem: A language L is accepted by some DFA if and only if L is accepted by some NFA

0,1

0

1

q0

q1

q2

q3

- An -NFA N = (Q, , , q0, F) where the definitions of Q, , q0, and F are same as for an NFA. is defined as follows:
: Q X {} 2Q

- Epsilon-closure (ECLOSE):
/* associates a set of states with a given state */

basis: state q is in ECLOSE(q)induction: if p is in ECLOSE(q) and (p, ) contains r, then r also is in ECLOSE(q)

Let E = (QE,, E, q0, FE), then the equivalent DFA

D = (QD, , D, qD , FD ) is defined as follows:

- QD is the set of subsets of QE
- qD = ECLOSE({q0 })
- (S, a) = ECLOSE( E (p, a)) where p S
- FD = {S | S is in QD and SFE }