Theory of Computation Automata Theory Dr. Ayman Srour.

Slides:



Advertisements
Similar presentations
CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
Advertisements

Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
Introduction to Computability Theory
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Finite Automata and Non Determinism
CS5371 Theory of Computation
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.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
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.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
1 Non-Deterministic Automata Regular Expressions.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
NFA ε - NFA - DFA equivalence. What is an NFA An NFA is an automaton that its states might have none, one or more outgoing arrows under a specific symbol.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Theory of Languages and Automata
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
Lecture Notes 
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
CSCI 2670 Introduction to Theory of Computing September 7, 2004.
Theory of Computation Automata Theory Dr. Ayman Srour.
Introduction to Automata Theory Theory of Computation Lecture 5 Tasneem Ghnaimat.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
1 Chapter 2 Finite Automata (part a) Hokkaido, Japan.
Theory of Computation Automata Theory Dr. Ayman Srour.
Theory of Computation Automata Theory Dr. Ayman Srour.
Theory of Computation Automata Theory Dr. Ayman Srour.
Theory of Languages and Automata By: Mojtaba Khezrian.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
Nondeterminism The Chinese University of Hong Kong Fall 2011
CIS Automata and Formal Languages – Pei Wang
Lexical analysis Finite Automata
Non Deterministic Automata
FORMAL LANGUAGES AND AUTOMATA THEORY
Finite Automata a b A simplest computational model
Chapter 2 FINITE AUTOMATA.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Lecture3 DFA vs. NFA, properties of RL
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Nondeterministic Finite Automata
Non Deterministic Automata
4b Lexical analysis Finite Automata
Chapter Five: Nondeterministic Finite Automata
CSCI 2670 Introduction to Theory of Computing
4b Lexical analysis Finite Automata
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
AUTOMATA THEORY.
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing
Non Deterministic Automata
Nondeterminism The Chinese University of Hong Kong Fall 2010
Presentation transcript:

Theory of Computation Automata Theory Dr. Ayman Srour

TOPIC 2: REGULAR LANGUAGES OUTLINE 2.1 Introduction 2.2 Finite Automata 2.3 Nondeterminism 2.4 Regular Expressions 2.5 Generalized Nondeterministic Finite Automaton

2.3 Non-determinism Determinism: ” given the current state we know what the next state will be” Only one unique next stat. No choice. No randomness (Perfect repeatability). No oracle. No Cheating (No error, No malfunction).

2.3 Non-determinism Normal computers are deterministic? Except they take random input. Random error may produced. So forget about it.

2.3 Non-determinism Nondeterminism is a useful concept that has had great impact on the theory of computation. So far in our discussion, every step of a computation follows in a unique way from the preceding step. Nondeterminism is the ability to make guesses, which we can later verify When the machine is in a given state and reads the next input symbol, we know what the next state will be-it is determined. We call this deterministic computation. In a nondeterministic machine, several choices may exist for the next state at any point. Nondeterminism is a generalization of determinism, so every deterministic finite automaton is automatically a nondeterministic finite automaton.

2.3 Non-determinism This is a kind of automaton that allows you to make guesses Each state can have zero, one, or more transitions out labeled by the same symbol State q 1 has two transitions labeled 1. Upon reading 1, we have the choice of staying in q 1 or moving to q 2. State q 2 has no transition labeled 1, instead have epsilon ε and 0. Upon reading 1 in q 2, we die; upon reading 0 or ε, we continue to q 3 Zero, one, or many arrows may exit from each state with the label ε.

2.3 Non-determinism How does an NFA compute? Suppose that we are running an NFA on an input string and come to a state with multiple ways to proceed. For example, say that we are in state q1 in NFA N 1 and that the next input symbol is a 1. after reading that symbol, the machine splits into multiple copies of itself and follows all the possibilities in parallel Each copy of the machine takes one of the possible ways to proceed and continues as before.

2.3 Non-determinism If there are subsequent choices, the machine splits again. If the next input symbol doesn't appear on any of the arrows exiting the state occupied by a copy of the machine, that copy of the machine dies, along with the branch of the computation associated with it. Finally, if anyone of these copies of the machine is in an accept state at the end of the input, the NFA accepts the input string.

2.3 Non-determinism Another way to think of a nondeterministic computation is as a tree of possibilities. The root of the tree corresponds to the start of the computation. Every branching point in the tree corresponds to a point in the computation at which the machine has multiple choices. The machine accepts if at least one of the computation branches ends in an accept state, as shown in the next slide.

2.3 Non-determinism

Try this string

2.3 Non-determinism every NFA can be converted into an equivalent DFA, and constructing NFAs is sometimes easier than directly constructing DFAs. An NFA may be much smaller than its deterministic counterpart, or its functioning may be easier to understand.

2.3 Non-determinism 1 0 0, 1 qq qq qq NFA:

2.3 Non-determinism 1 0 0, 1 qq qq qq NFA: DFA: 1 qq q 0 or q 1 q 0 or q

2.3 Non-determinism/ Formal definition A nondeterministic finite automaton (NFA) is a 5-tuple (Q, , , q 0, F) where Q is a finite set of states  is an alphabet  : Q ×  → subsets of Q is a transition function q 0  Q is the initial state F  Q is a set of accepting states (or final states). Only difference from DFA is that output of  is a set of states

2.3 Non-determinism/ Example , 1 qq qq qq qq alphabet  = {0, 1} start state Q = {q 0, q 1, q 2, q 3 } initial state q 0 accepting states F = {q 3 } states inputs 0 1 q0q0 q1q1 q2q2 {q 0, q 1 } transition function  q3q3 {q 0 } {q 2 }    {q 3 } 

2.3 Non-determinism Obviously, an NFA can do everything a DFA can do But can it do more?

2.3 Non-determinism Obviously, an NFA can do everything a DFA can do But can it do more? Theorem A language L is accepted by some DFA if and only if it is accepted by some NFA. NO!