1 / 11

Nondeterminism – Converting NFAs to DFAs

Nondeterminism – Converting NFAs to DFAs. Lecture 9 Section 1.2 Mon, Sep 10, 2007. Definition of an NFA. For an NFA, define the transition function as  : Q      ( Q ), where   =   {  }. Example. Let A = { x | x contains an even number of a ’s}.

jamuna
Download Presentation

Nondeterminism – Converting NFAs to DFAs

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nondeterminism – Converting NFAs to DFAs Lecture 9 Section 1.2 Mon, Sep 10, 2007

  2. Definition of an NFA • For an NFA, define the transition function as  : Q(Q), where  =  {}.

  3. Example • Let A = {x | x contains an even number of a’s}. • Let B = {x | x contains an even number of b’s}. • Describe  for the NFA that accepts AB. • Do the computation for the string abaabb.

  4. Equivalence of NFAs and DFAs • Theorem: For every NFA, there is a DFA that accepts the same language. • Constructive Proof: • For each state in the NFA, form its “-closure.”

  5. The -Closure of a State • Given a state q, the -closure of q, denoted E(q), is the set of all states, including q itself, that can be reached using only -moves.

  6. Equivalence of NFAs and DFAs • The set of states of the DFA is Q = (Q). • The initial state of the DFA is E(q0). • Define : • For any state S(Q) and any a, (S, a) = qSE((q, a)). • The final states of the DFA are those states that contain final states of the NFA.

  7. Example • Let A = {x | x contains an even number of a’s}. • Let B = {x | x contains an even number of b’s}. • Construct a DFA from the NFA that accepts AB. • Do the computation for the string abaabb on the DFA.

  8. Examples • Let = {a, b}. • Let A be the set of all strings containing ab followed eventually by aa. • Let B be the set of all strings containing ba followed eventually by bb.

  9. Examples • Consider the language AB. • How is the string ababb processed? • Construct a DFA that accepts AB.

  10. Examples • Let A be the set of all strings that • contain at least one a, and • contain no more than one b. • How is the string abbaaba processed? • Construct a DFA that accepts A*.

  11. a, b b a a b b a a, b Examples • A DFA for A* is

More Related