Deterministic finite automaton
This presentation is the property of its rightful owner.
Sponsored Links
1 / 15

Deterministic Finite Automaton PowerPoint PPT Presentation


  • 50 Views
  • Uploaded on
  • Presentation posted in: General

Deterministic Finite Automaton. A deterministic finite automaton (DFA) is a five-tuple A = (Q, , , q 0, F) where Q is a finite set of states  is a finite set of input symbols  is a function : Q   Q called transition function q 0  Q is called the start state

Download Presentation

Deterministic Finite Automaton

An Image/Link below is provided (as is) to download presentation

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 - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Deterministic finite automaton

Deterministic Finite Automaton

  • 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


Deterministic finite automaton1

Deterministic Finite Automaton

  • 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


Deterministic finite automaton2

Deterministic Finite Automaton

  • 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 *.


Deterministic finite automaton3

Deterministic Finite Automaton

0,1

0

1

1

0

q2

q0

q1


Deterministic finite automaton4

Deterministic Finite Automaton

  • Transition function on strings:

    Let w=xa

    1)

    2)


Deterministic finite automaton5

Deterministic Finite Automaton

  • 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


Example l w w has even 0s and even 1s

1

q1

q0

1

0

0

0

0

1

q2

q3

1

Example L= {w | w has even 0s and even 1s}


Nondeterministic finite automaton

Nondeterministic Finite Automaton

  • 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


Nondeterministic finite automaton1

Nondeterministic Finite Automaton

  • Extended transition function:

  • The language of an NFA A = (Q, , , q0, F):


Example l w w ends with 01

0,1

start

q0

q1

q2

0

1

Example – L = {w | w ends with 01}


Equivalence of dfa and nfa

Equivalence of DFA and NFA

  • 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


Equivalence of dfa and nfa1

Equivalence of DFA and NFA

  • 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


Finite automata with transitions

0,1

0

1

q0

q1

q2

q3

Finite Automata with -transitions

  • 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


Function eclose

Function ECLOSE

  • 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)


Eliminating transitions

Eliminating -transitions

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 SFE  }


  • Login