CSE 105 theory of computation

Slides:



Advertisements
Similar presentations
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Advertisements

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Deterministic Finite Automata (DFA)
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
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.
Nonregular languages Sipser 1.4 (pages 77-82). CS 311 Fall Nonregular languages? We now know: –Regular languages may be specified either by regular.
Finite Automata and Non Determinism
CS5371 Theory of Computation
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
1 Languages and Finite Automata or how to talk to machines...
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections: September 1, 2006.
Topics Automata Theory Grammars and Languages Complexities
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.
Finite Automata Costas Busch - RPI.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Great Theoretical Ideas in Computer Science.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Rosen 5th ed., ch. 11 Ref: Wikipedia
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Theory of Computation - Lecture 3 Regular Languages What is a computer? Complicated, we need idealized computer for managing mathematical theories... Hence:
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
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: 
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
Formal Languages Finite Automata Dr.Hamed Alrjoub 1FA1.
Lecture #4 Thinking of designing an abstract machine acts as finite automata. Advanced Computation Theory.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Costas Busch - LSU1 Deterministic Finite Automata And Regular Languages.
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.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
Lecture Three: Finite Automata Finite Automata, Lecture 3, slide 1 Amjad Ali.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
Languages.
Deterministic Finite Automata And Regular Languages.
Lexical analysis Finite Automata
Lecture2 Regular Language
CSE 105 theory of computation
CSE 105 theory of computation
Nondeterministic Finite Automata
Finite Automata & Regular Languages
Hierarchy of languages
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Chapter Two: Finite Automata
COSC 3340: Introduction to Theory of Computation
4b Lexical analysis Finite Automata
Chapter Five: Nondeterministic Finite Automata
Deterministic Finite Automaton (DFA)
CSE 105 theory of computation
4b Lexical analysis Finite Automata
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
CSE 105 theory of computation
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: ={0,1},
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

CSE 105 theory of computation Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse105-a/

Today's learning goals Sipser Ch 1.1 Use and design a finite automaton via its - Formal definition - state diagram Identify the strings and languages accepted by a given finite automaton Design a finite automaton which accepts a given language Define the regular operations on languages

Deterministic Finite Automaton (DFA) Input: finite string over a fixed alphabet Output: "accept" or "reject" Language of the machine is the set of strings it accepts Start state (triangle/arrow) Accept state (double circle)

Deterministic finite automaton Input: finite string over a fixed alphabet Output: "accept" or "reject" Does this DFA accept the empty string ? Yes No I don't know

Deterministic finite automaton Sipser p. 35 Def 1.5 No circles and arrows, same information!

Deterministic finite automaton Sipser p. 35 Def 1.5 Can there be more than one start state in a finite automaton? Yes, because of line 4. No, because of line 4. I don't know

Deterministic finite automaton Sipser p. 35 Def 1.5 How many outgoing arrows from each state? May be different number at each state. Must be 2. Must be |Q|. Must be |Σ| I don't know.

An example Define M = where the function δ is specified by its table of values: Draw the state diagram for the DFA with this formal definition. Input in Q x Σ Output in Q (q1,a) q3 (q2,a) q2 (q3,a) (q4,a) Input in Q x Σ Output in Q (q1,b) q2 (q2,b) (q3,b) q4 (q4,b)

An example What's an example of a length 1 string accepted by this DFA? length 1 string rejected by this DFA? length 2 string accepted by this DFA? length 2 string rejected by this DFA?

An example What's the best description of the language recognized by this DFA? Starts with b and ends with a or b Starts with a and ends with a or b a's followed by b's More than one of the above I don't know. and using set notation?

An example This DFA recognizes the language of all strings of the form a's followed by b's i.e. { anbk | n,k ≥ 1}

Specifying an automaton ( {q1,q2,q3}, {a,b}, δ, q1, ? ) What state(s) should be in F so that the language of this machine is { w | ab is a substring of w}? {q2} {q3} {q1,q2} {q1,q3} I don't know.

Specifying an automaton ( {q1,q2,q3}, {a,b}, δ, q1, ? ) What state(s) should be in F so that the language of this machine is { w | b's never occur after a's in w}? {q2} {q3} {q1,q2} {q1,q3} I don't know.

Building DFA Typical questions Define a DFA which recognizes the given language L. or Prove that the (given) language L is regular.

Building DFA Example Define a DFA which recognizes { w | w has at least 2 a's}

Building DFA Example Define a DFA which recognizes { w | w has at most 2 a's}

Building DFA Remember States are our only (computer) memory. Design and pick states with specific roles / tasks in mind. "Have not seen any of desired pattern yet" "Trap state"

Justification? To prove that the DFA we build, M, actually recognizes the language L WTS L(M) = L Is every string accepted by M in L? Is every string from L accepted by M? or contrapositive version: Is very string rejected by M not in L.

A useful (optional) bit of terminology When is a string accepted by a DFA? Computation of M on w: where do we land when start at q0 and read each symbol of w one-at-a time? δ*( q, w ) = Recursively defined function

Regular languages Sipser p. 35 Def 1.5 For DFA M over the alphabet Σ For each string w over Σ, M either accepts w or rejects w The language recognized by M is the set of strings M accepts The language of M is the set of strings M accepts L(M) = { w | w is a string over Σ and M accepts w} A language is regular iff there is some finite automaton that recognizes exactly it.

Regular languages: bounds? Is every finite language regular? No: some finite languages are regular, and some are not. No: there are no finite regular languages. Yes: every finite language is regular. I don't know.

For next time Complete Review Quiz 1 by Friday night Continue working on Homework 1 due Monday night Set up course tools: Gradescope, Piazza Find group members Read all the questions Start working  Review CSE 20 / Math 109 / CSE 21 / Sipser Ch 0 as needed.