Athasit Surarerks 2110711 THEORY OF COMPUTATION 07 NON-DETERMINISTIC FINITE AUTOMATA 1.

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Lecture 6 Nondeterministic Finite Automata (NFA)
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
8/27/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 2 Theory of Computation Finite Automata Operations on languages Nondeterminism L2.1.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
CS21 Decidability and Tractability
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof Latex files on ella.
NFAs Sipser 1.2 (pages 47–54). CS 311 Fall Recall… Last time we showed that the class of regular languages is closed under: –Complement –Union.
NFAs and DFAs Sipser 1.2 (pages 47-63). Last time…
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
NFAs Sipser 1.2 (pages 47–54). CS 311 Mount Holyoke College 2 Recall… Last time we showed that the class of regular languages is closed under: –Complement.
Introduction to Computability Theory
1 Introduction to Computability Theory Discussion1: Non-Deterministic Finite Automatons Prof. Amos Israeli.
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
CS5371 Theory of Computation
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections:1.1 page 44 September 8, 2006.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Pushdown Automaton (PDA)
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
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.
Regular Expressions (RE) Empty set Φ A RE denotes the empty set Empty string λ A RE denotes the set {λ} Symbol a A RE denotes the set {a} Alternation M.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
THEORY OF COMPUTATION 08 KLEENE’S THEOREM.
REGULAR LANGUAGES.
Theory of Languages and Automata
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: 
Kleene’s Theorem Group No. 3 Presented To Mam Amina Presented By Roll No Roll No Roll No Roll No Group No. 3 Presented To Mam.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Modeling Computation: Finite State Machines without Output
Lecture Notes 
Nondeterministic Finite Automata (NFAs). Reminder: Deterministic Finite Automata (DFA) q For every state q in Q and every character  in , one and only.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1 Finite Automata. 2 Introductory Example An automaton that accepts all legal Pascal identifiers: Letter Digit Letter or Digit "yes" "no" 2.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Theory of Computation Automata Theory Dr. Ayman Srour.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
Non Deterministic Automata
Nondeterministic Finite Automata
Finite Automata & Regular Languages
Chapter 2 FINITE AUTOMATA.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
CSE322 Finite Automata Lecture #2.
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
CSE322 Definition and description of finite Automata
Nondeterministic Finite Automata
Non Deterministic Automata
Finite Automata.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
Finite-State Machines with No Output
CSC 4170 Theory of Computation Finite Automata Section 1.1.
CSCI 2670 Introduction to Theory of Computing
Non Deterministic Automata
Presentation transcript:

Athasit Surarerks THEORY OF COMPUTATION 07 NON-DETERMINISTIC FINITE AUTOMATA 1

IMPORTANT 2 We introduce a conceptual machine that occurs in practice more frequently than the transition graph.

TRANSITION GRAPH 3 Definition A transition graph (abbreviated TG) is a 5-tuple (Q, , q 0, , A) where Q means a finite set of states.  is a finite input alphabet. q 0  Q named Initial state. A  Q, A is the set of all accepted states.  is a function from Q   * to P(Q), called transition function.

TRANSITION GRAPH 4 q2q2 1 q3q3 1 q0q0 q1q

EXAMPLE 5 (0+1)*00(0+1)* q0q0 q1q1 0 q2q2 0 0,1

EXAMPLE 6 ( )*0(0+1)* q0q0 0 q1q1 1 0,1 q2q2 q3q3 0 1 q4q4 q5q

NON-DETERMINISTIC MACHINE 7 A nondeterministic finite state machine (NFA) is a transition graph with a unique start state and each of its edge labels is a single alphabet.

NON-DETERMINISTIC MACHINE 8 Definition A nondeterministic finite automaton (abbreviated NFA) is a 5-tuple (Q, ,q 0,A,  ). where Q means a finite set of states.  is a finite input alphabet. q 0 is in Q named Initial state. A is a subset of Q, A is the set of all accepted states.  is a function from Q   to P(Q) where P(Q) is the power set of Q.

NON-DETERMINISTIC MACHINE 9 A B 0 C 0,1 D *(A,00)  *(A,00)=  (r,0): r   *(A,0) : r  { A, B } = { A, B }  { C } = { A, B, C } How to define the transition function?

NON-DETERMINISTIC MACHINE 10 A B 0 C 0,1 D *(A,010)  *(A,010)=   (r,0): r   *(A,01)  *(A,01)=   (s,1): s   *(A,0) : s  { A, B } =  (A,1)   (B,1) = { A }  { C }: r  { A, C }  *(A,010) =  (A,0)   (C,0) = { A, B }  { D } = { A, B, D }

NON-DETERMINISTIC MACHINE 11 For a NFA, M = (Q, , q 0, , A) and any p  Q,  *(p,  ) = {p}. For any p  Q and x = a 1 a 2 a 3 …a n   * (with n  1)  *(p, x) is the set of all states q for which there is a sequence of states p=p 0, p 1 p 2 …p n-1, p n = q satisfying :  p i  (p i-1,a i ) for each i with 1  i  n. String x in  * is accepted by a NFA if  *(q 0,x)  A  .  *(p,  ) = {p}  *(p,ya n ) =  all r  *(p,y)  (r,a n )

NON-DETERMINISTIC MACHINE 12 Definition A nondeterministic finite automaton with  - transition (NFA-  ) is a 5-tuple (Q, , q 0, , A) where Q means a finite set of states.  is a finite input alphabet. q 0  Q named Initial state. A  Q, A is the set of all accepted states.  is a function from Q  (   {  }) to P(Q)  where P(Q) is the power set of Q.

NON-DETERMINISTIC MACHINE 13 For an NFA- , M=(Q, , q 0, , A) states p and q  Q and a string x = a 1 a 2 a 3 …a n   *, we will say M moves from p to q by a sequence of transitions corresponding to x if there exist an integer m  n, a sequence b 1 b 2 b 3 …b m  {  } satisfying x = b 1 b 2 b 3 …b m and a sequence of states p = p 0, p 1, p 2, …, p m = q so that for each i, 1  i  m, p i   (p i-1,b i ). For x   * and p  Q,  *(p,x) is the set of all states q  Q such that there is a sequence of transitions corresponding to x by which M moves from p to q.

 -CLOSURE 14 Definition Let M=(Q, , q 0, , A) be a NFA- . Let S be any subset of Q. The  -closure of S is the set  (S) defined as follows: Every element of S is an element of  (S). For any q   (S), every element of  (q,  ) is in  (S). No other elements of Q are in  (S).

 -CLOSURE 15 For a NFA-  M = (Q, , q 0, , A). The extended transition function  *: Q  *  P(Q) is defined as follows: For any q  Q,  *(q,  ) =  ({q}) For any q  Q, y   * and a  ,  *(q,ya) =  (  r  *(q,y)  (r,a) ) A string x is accepted by M if  *(q 0,x)  A  . The language recognized by M is the set L(M) of all strings accepted by M.

NON-DETERMINISTIC MACHINE 16 Theorem For every nondeterministic finite state machine, there is a finite state machine accepts exactly the same language. PROOF

NON-DETERMINISTIC MACHINE 17 Theorem For every nondeterministic finite state machine with  -transition, there is a finite state machine accepts exactly the same language. PROOF

EXERCISE 18 จงยกตัวอย่าง ภาษาที่บรรยายด้วย การ บรรยายแบบสม่ำเสมอ ที่มี non-deterministic automaton with  -transition ที่ accept ทุก สมาชิกในภาษาได้ แต่ไม่สามารถถูกยอมรับได้ ด้วย non-deterministic finite automaton ที่มี accepted state เพียงสถานะเดียว