Lecture 2UofH - COSC 3340 - Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.

Slides:



Advertisements
Similar presentations
4b Lexical analysis Finite Automata
Advertisements

Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Lecture 23UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 23.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Lecture 6 Nondeterministic Finite Automata (NFA)
Theory Of Automata By Dr. MM Alam
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
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
Transparency No. 2-1 Formal Language and Automata Theory Chapter 2 Deterministic Finite Automata (DFA) (include Lecture 3 and 4)
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Lecture 13 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA.
1 Languages and Finite Automata or how to talk to machines...
Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.
Lecture 9UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 9.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
Finite Automata Costas Busch - RPI.
Lecture 5UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 5.
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
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.
Lecture 3 Graph Representation for Regular Expressions
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
UofH - COSC Dr. Verma COSC 3340: Introduction to Theory of Computation Rakesh Verma Computer Science Department University of Houston URL:
CSCI 2670 Introduction to Theory of Computing August 24, 2005.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Lecture 18UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 18.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
1 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
Lecture 11UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11.
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
Lecture 14UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 14.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
Costas Busch - LSU1 Deterministic Finite Automata And Regular Languages.
Theory of Languages and Automata By: Mojtaba Khezrian.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
Deterministic Finite Automata And Regular Languages.
COSC 3340: Introduction to Theory of Computation
Lecture2 Regular Language
Non Deterministic Automata
COSC 3340: Introduction to Theory of Computation
Theory of Computation Lecture # 9-10.
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
COSC 3340: Introduction to Theory of Computation
CSE322 Definition and description of finite Automata
Non Deterministic Automata
Principles of Computing – UFCFA3-30-1
4b Lexical analysis Finite Automata
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
4b Lexical analysis Finite Automata
COSC 3340: Introduction to Theory of Computation
Chapter # 5 by Cohen (Cont…)
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Non Deterministic Automata
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2

UofH - COSC Dr. Verma 2 1st model -- Deterministic Finite Automaton (DFA) Finite Control Read only Head

Lecture 2UofH - COSC Dr. Verma 3 DFA (contd.) The DFA has: – a finite set of states – 1 special state - initial state – 0 or more special states - final states – input alphabet – transition table containing (state, symbol) -> next state

Lecture 2UofH - COSC Dr. Verma 4 Informally -- How does a DFA work? An input string is placed on the tape (left-justified). DFA begins in the start state. Head placed on leftmost cell. DFA goes into a loop until the entire string is read. – In each step, DFA consults a transition table and changes state based on (s,  ) where s - current state  - symbol scanned by head

Lecture 2UofH - COSC Dr. Verma 5 How does a DFA work? (contd.) After reading input string, – if DFA state final, input accepted – if DFA state not final, input rejected Language of DFA -- set of all strings accepted by DFA.

Lecture 2UofH - COSC Dr. Verma 6 Pictorial representation of DFA (q,σ) - > q'

Lecture 2UofH - COSC Dr. Verma 7 Example: Diagram of DFA L = {a 2n + 1 | n >= 0} Answer: L = {a, aaa, aaaaa,...}

Lecture 2UofH - COSC Dr. Verma 8 JFLAP Step-By-Step aaa

Lecture 2UofH - COSC Dr. Verma 9 JFLAP Step-By-Step aaa

Lecture 2UofH - COSC Dr. Verma 10 JFLAP Step-By-Step aaaaaa

Lecture 2UofH - COSC Dr. Verma 11 JFLAP Step-By-Step aaa

Lecture 2UofH - COSC Dr. Verma 12 Formal definition of DFA DFA M = (Q, , , s, F) Where, – Q is finite set of states –  is input alphabet – s  Q is initial state – F  Q is set of final states –  : Q X  - > Q

Lecture 2UofH - COSC Dr. Verma 13 Formal definition of L(M) L(M) - Language accepted by M Define  * : –  * (q,  ) = q –  * (q, wσ) =  (  * (q,w),σ) Definition: L(M) = { w in  * |  * (s,w) in F }.

Lecture 2UofH - COSC Dr. Verma 14 Example: L(M) = {w in {a,b}* | w contains even no. of a's}

Lecture 2UofH - COSC Dr. Verma 15 JFLAP Step-By-Step aa

Lecture 2UofH - COSC Dr. Verma 16 JFLAP Step-By-Step a

Lecture 2UofH - COSC Dr. Verma 17 JFLAP Step-By-Step a

Lecture 2UofH - COSC Dr. Verma 18 JFLAP Step-By-Step ab

Lecture 2UofH - COSC Dr. Verma 19 JFLAP Step-By-Step abab

Lecture 2UofH - COSC Dr. Verma 20 JFLAP Step-By-Step abab

Lecture 2UofH - COSC Dr. Verma 21 Given a language, how to define DFA? Creative process requiring you to: (i) Put yourself in DFA's shoes (ii) Find finite amount of info, based on which string accepted/rejected (iii) From step (ii), determine number of states and then transitions.

Lecture 2UofH - COSC Dr. Verma 22 Regular Languages Definition: A Language is regular iff there is a DFA that accepts it. Examples: –  – {  } –  * – {w in {0,1}* | second symbol of w is a 1} Exercise – {w in {0,1}* | second last symbol of w is a 1} Exercise – {w in {0,1}* | w contains 010 as a substring} - (importance?)