1 / 16

Nondeterminism

This text compares the formal definitions and computations of Nondeterministic Finite Automaton (NFA) and Deterministic Finite Automaton (DFA), discussing their similarities and differences. It also includes the proof of Kleene's Theorem.

awren
Download Presentation

Nondeterminism

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. [Section 4.1] Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens when we drop this requirement ? L = { w2{a,b}* | w contains abba as a substring } Transition diagram (of this new type) :

  2. [Section 4.1] Formal definition of an NFA • A nondeterministic finite automaton (NFA) is a 5-tuple (Q,,q0,A,) where • Q is a finite set of states •  is a finite alphabet (input symbols) • qo2 Q is the initial state • A µ Q is a set of accepting states •  : Q£ ___ is the transition function • Give a formal definition of the NFA from the previous slide.

  3. [Section 4.1] Formal definition of an NFA Defining the computation of an NFA M=(Q,,q0,A,). Extended transition function * : Q£* ____ : 1) For every q 2 Q, let *(q,) = 2) For every q 2 Q, y 2*, and 2, let *(q,y) = We say that a string x 2* is accepted by M if ________ . A string which is not accepted by M is rejected by M. The language accepted by M, denoted by L(M) is the set of all strings accepted by M.

  4. [Section 4.1] NFA’s vs. FA’s Is the following statement true ? For every FA M = (Q,,q0,A,) there exists an NFA M1 = (Q1,,q1,A1,1) such that L(M) = L(M1).

  5. [Section 4.1] NFA’s vs. FA’s Is the following statement true ? For every NFA M = (Q,,q0,A,) there exists an FA M1 = (Q1,,q1,A1,1) such that L(M) = L(M1). Example : a a b b a,b b

  6. [Section 4.1] NFA’s vs. FA’s Thm : For every NFA M = (Q,,q0,A,) there exists an FA M1 = (Q1,,q1,A1,1) such that L(M) = L(M1). Construction of M1 : Proof that L(M) = L(M1) :

  7. [Section 4.2] NFA’s with  Example : NFA accepting a*b*c*.

  8. [Section 4.2] Formal definition of an NFA- • A nondeterministic finite automaton with -transitions (NFA-) is a 5-tuple (Q,,q0,A,) where • Q is a finite set of states •  is a finite alphabet (input symbols) • qo2 Q is the initial state • A µ Q is a set of accepting states •  :  is the transition function • Give a formal definition of the NFA- from the previous slide.

  9. [Section 4.2] Formal definition of an NFA- Defining the computation of an NFA- M=(Q,,q0,A,). Extended transition function * : ____  ____ : 1) For every q 2 Q, let *(q,) = 2) For every q 2 Q, y 2*, and 2, let *(q,y) =

  10. [Section 4.2] Formal definition of an NFA- • Defining the computation of an NFA- M=(Q,,q0,A,). • Extended transition function * : Q£* 2Q : • 1) For every q 2 Q, let *(q,) = { q } • For every q 2 Q, y 2*, and 2, let *(q,y) = -closure of a set S µ Q, denoted (S), is the set of all states reachable from S by a sequence of -transitions. Define (S) :

  11. [Section 4.2] Formal definition of an NFA- Defining the computation of an NFA- M=(Q,,q0,A,). Extended transition function * : Q£* 2Q : 1) For every q 2 Q, let *(q,) = { q } 2) For every q 2 Q, y 2*, and 2, let *(q,y) = [p2*(q,y) ((p,)) We say that a string x 2* is accepted by M if ________. A string which is not accepted by M is rejected by M. The language accepted by M, denoted by L(M) is the set of all strings accepted by M.

  12. [Section 4.2] NFA-’s vs. NFA’s Is the following statement true ? For every NFA M = (Q,,q0,A,) there exists an NFA- M1 = (Q1,,q1,A1,1) such that L(M) = L(M1).

  13. [Section 4.2] NFA-’s vs. NFA’s Is the following statement true ? For every NFA- M = (Q,,q0,A,) there exists an NFA M1 = (Q1,,q1,A1,1) such that L(M) = L(M1).

  14. [Section 4.3] Proof of Kleene’s Thm Kleene’s Thm: A language L over  is regular iff there exists a finite automaton that accepts L. Part 1 : For every regular language there exists an NFA- accepting it.

  15. [Section 4.3] Proof of Kleene’s Thm Part 2 : Any language accepted by an FA is regular. Let M=({1,2,3,…,k},,q0,A,) be an FA. We will show that for every p,q,r 2 Q, the following language is regular : L(p,q,r) = { x2* | *(p,x)=q and for every prefix y of x other than  and x we have *(p,y) · r } Can we then conclude that L(M) is regular ?

  16. [Section 4.3] Proof of Kleene’s Thm Claim : Let M=({1,2,3,…,k},,q0,A,) be an FA. For every p,q,r 2 Q, the following language is regular : L(p,q,r) = { x2* | *(p,x)=q and for every prefix y of x other than  and x we have *(p,y) · r }

More Related