Theory of Computation Automata Theory Dr. Ayman Srour.

Slides:



Advertisements
Similar presentations
4b Lexical analysis Finite Automata
Advertisements

CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
January 7, 2015CS21 Lecture 21 CS21 Decidability and Tractability Lecture 2 January 7, 2015.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
Chapter Section Section Summary Set of Strings Finite-State Automata Language Recognition by Finite-State Machines Designing Finite-State.
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
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.
Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Fall 2008.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections: September 1, 2006.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 1 Regular Languages Contents Finite Automata (FA or DFA) definitions, examples,
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.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Topics Automata Theory Grammars and Languages Complexities
CSC 361Finite Automata1. CSC 361Finite Automata2 Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers.
1.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
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.
Rosen 5th ed., ch. 11 Ref: Wikipedia
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
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
Theory of Computation - Lecture 3 Regular Languages What is a computer? Complicated, we need idealized computer for managing mathematical theories... Hence:
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
Deterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.2)
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Lecture Notes 
Theory of Computation Automata Theory Dr. Ayman Srour.
Theory of Computation Automata Theory Dr. Ayman Srour.
Theory of Computation Automata Theory Dr. Ayman Srour.
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.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
Finite Automata.
Nondeterminism The Chinese University of Hong Kong Fall 2011
CSCI 2670 Introduction to Theory of Computing
Finite State Machines Dr K R Bond 2009
Lexical analysis Finite Automata
Lecture2 Regular Language
Compilers Welcome to a journey to CS419 Lecture5: Lexical Analysis:
G. Pullaiah College of Engineering and Technology
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
Non-Deterministic Finite Automata
Chapter Two: Finite Automata
COSC 3340: Introduction to Theory of Computation
CSE322 Definition and description of finite Automata
Non Deterministic Automata
Finite Automata.
Finite Automata.
4b Lexical analysis Finite Automata
4b Lexical analysis Finite Automata
Chapter 1 Regular Language
Formal Languages and Automata Theory BODDEDA HARITHA LAKSHMI,
Non Deterministic Automata
What is it? The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled.
Automata theory and formal languages COS 3112 – AUTOMATA THEORY PRELIM PERIOD WEEK 1 AND 2.
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.1 Finite Automata

Finite automata are good models for computers with an extremely limited or finite amount of memory. So, it defined as the simplest model of computation. Finite State Machine (FSM) or Finite State Automata (FSA) What can a computer do with such a small memory?

2.1 Finite Automata Example of a finite automaton: There are states off and on, the automaton starts in off and tries to reach the “good state” on What sequences of f s lead to the good state? Answer: {f, fff, fffff, …} = {f n : n is odd } This is an example of a deterministic finite automaton over alphabet {f} off on f f

2.1 Finite Automata We will now take a closer look at finite automata from a mathematical perspective. In beginning to describe the mathematical theory of finite automata, we do so in the abstract, without reference to any particular application. The following figure depicts a finite automaton called M I.

2.1 Finite Automata The figure called the state diagram of M l It has three states, labeled q l, q 2, and q 3. The start/initial state, q l, is indicated by the arrow pointing at it from nowhere. The accept/final state, q 2, is the one with a double circle. The arrows going from one state to another are called transitions.

2.1 Finite Automata When this automaton receives an input string such as 1101, it processes that string and produces an output. The output is either accept or reject. The processing begins in M 1 's start state. The automaton receives the symbols from the input string one by one from left to right. After reading each symbol, M1 moves from one state to another along the transition that has that symbol as its label. When it reads the last symbol, M1 produces its output. The output is accept if M 1 is now in an accept state and reject if it is not.

2.1 Finite Automata Try this string Start in state q1. 2. Read 1, follow transition from q1 to q2. 3. Read 1, follow transition from q2 to q2. 4. Read 0, follow transition from q2 to q3. 5. Read 1, follow transition from q3 to q2. 6. Accept because M1 is in an accept state q2 at the end of the input.

2.1 Finite Automata try these strings 1, 01, 1 1, and and these 100, 0100, , and What about these strings 0, 10, ? What is the pattern? Can you describe the language consisting of all strings that Ml accepts?

2.1 Finite Automata Forma Definition of finite automaton a finite automat is a 5-tuple (Q, , , q 0, F) where Q is a finite set of states  is an alphabet  : Q ×  → Q is a transition function q 0  Q is the initial state F  Q is a set of accepting states (or final states).

2.1 Finite Automata Example: q0q0 q1q1 q2q ,11 alphabet  = {0, 1} state Q = {q 0, q 1, q 2 } initial state q 0 accepting states F = {q 0, q 1 } states inputs 0 1 q0q0 q1q1 q2q2 q0q0 q1q1 q2q2 q2q2 q2q2 q1q1 transition function 

2.1 Finite Automata

2.1 Finite Automata\Examples Construct a machine that accepts the language L = {010, 1} (  = {0, 1} )

2.1 Finite Automata\Examples Construct a machine that accepts the language Answer L = {010, 1} (  = {0, 1} ) qq q0q0 q1q1 q 01 q 010 q die 0,

2.1 Finite Automata\Examples Construct a FSA over alphabet {0, 1} that accepts all strings with at most three 1 s

2.1 Finite Automata\Examples Construct a FSA over alphabet {0, 1} that accepts all strings with at most three 1 s Answer q0q0 q1q q2q2 0 q3q3 1 q 4+ 0,

2.1 Finite Automata We already have an informal idea of the way finite automaton computes, and we now formalize it mathematically.

2.1 Finite Automata A language is called a regular language if some finite automaton recognizes it. Here is the state diagram of finite automaton M.

2.1 Finite Automata A language is called a regular language if some finite automaton recognizes it. Here is the state diagram of finite automaton M. In the formal description M2 = ({q i,q 2 }, {0,1},∂,q 1, {q 2 }). The transition function a is 