Course Material. CS Lecture 1 Deterministic Finite Automata. Grading and Policies. Workload. Website:http://www.cs.colostate.

Similar documents
Content. Languages, Alphabets and Strings. Operations on Strings. a ab abba baba. aaabbbaaba b 5. Languages. A language is a set of strings

Module 9: String Matching

Formal Languages The Pumping Lemma for CFLs

Applications of Regular Closure

Review of CFGs and Parsing I Context-free Languages and Grammars. Winter 2014 Costas Busch - RPI 1

is an ordered list of numbers. Each number in a sequence is a term of a sequence. n-1 term

input tape head moves current state

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

A Turing Machine. The Tape. Languages accepted by Turing Machines. Tape... Read-Write head. Context-Free n Languages. Control Unit.

Fundamentals of Computer Science

Formal Languages and Automata

Languages. A language is a set of strings. String: A sequence of letters. Examples: cat, dog, house, Defined over an alphabet:

Homework 3 Solutions

Lecture 08: Feb. 08, 2019

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

Let's start with an example:

CISC 4090 Theory of Computation

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Regular expressions, Finite Automata, transition graphs are all the same!!

Deterministic Finite Automata

CSC 311 Theory of Computation

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

RULES FOR MANIPULATING SURDS b. This is the addition law of surds with the same radicals. (ii)

Midterm 1 Practice. CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/

CD5080 AUBER RECAPITULATION. Context-Free Languages. Models of Computation, Languages and Automata. S asb. S bsb

Chapter 2 Finite Automata

Lecture 2.5: Sequences

MTH 146 Class 16 Notes

Finite-State Automata: Recap

Name Ima Sample ASU ID

ICS141: Discrete Mathematics for Computer Science I

Formal languages, automata, and theory of computation

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Advanced Calculus Test File Spring Test 1

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Harvard University Computer Science 121 Midterm October 23, 2012

Some Properties of Brzozowski Derivatives of Regular Expressions

,... are the terms of the sequence. If the domain consists of the first n positive integers only, the sequence is a finite sequence.

CS375: Logic and Theory of Computing

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Deterministic Finite-State Automata

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

Minimal DFA. minimal DFA for L starting from any other

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

Discrete Mathematics I Tutorial 12

Week 13 Notes: 1) Riemann Sum. Aim: Compute Area Under a Graph. Suppose we want to find out the area of a graph, like the one on the right:

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

In-depth introduction to main models, concepts of theory of computation:

Section 6.3: Geometric Sequences

Some Theory of Computation Exercises Week 1

Java II Finite Automata I

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

Limits and an Introduction to Calculus

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

State Minimization for DFAs

Thoery of Automata CS402

Today s Topics Automata and Languages

Automata and Languages

CMSC 330: Organization of Programming Languages

Chapter 10: The Z-Transform Adapted from: Lecture notes from MIT, Binghamton University Hamid R. Rabiee Arman Sepehr Fall 2010

First Midterm Examination

Non-deterministic Finite Automata

Algebra II, Chapter 7. Homework 12/5/2016. Harding Charter Prep Dr. Michael T. Lewchuk. Section 7.1 nth roots and Rational Exponents

Theory of Computation Regular Languages

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Introduction to Computational Molecular Biology. Suffix Trees

Worked out examples Finite Automata

Non-deterministic Finite Automata

Non Deterministic Automata. Formal Languages and Automata - Yonsei CS 1

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

{ } { S n } is monotonically decreasing if Sn

CS375: Logic and Theory of Computing

The limit comparison test

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Project 3: Using Identities to Rewrite Expressions

Chapter 7 Infinite Series

Formal Language and Automata Theory (CS21004)

CS 330 Formal Methods and Models

Chapter 10: The Z-Transform Adapted from: Lecture notes from MIT, Binghamton University Dr. Hamid R. Rabiee Fall 2013

Lexical Analysis Part III

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Mathacle. PSet Stats, Concepts In Statistics Level Number Name: Date:

POWER SERIES R. E. SHOWALTER

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

General properties of definite integrals

NFAs continued, Closure Properties of Regular Languages

Math 104: Final exam solutions

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Lecture 17

Course 121, , Test III (JF Hilary Term)

Infinite Series Sequences: terms nth term Listing Terms of a Sequence 2 n recursively defined n+1 Pattern Recognition for Sequences Ex:

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

FIR Filters. Lecture #7 Chapter 5. BME 310 Biomedical Computing - J.Schesser

Chapter 4 Regular Grammar and Regular Sets. (Solutions / Hints)

Transcription:

Course Mteril CS 301 - Lecture 1 Determiistic Fiite Automt Fll 2008 Wesite:http://www.cs.colostte.edu/~cs301 Syllus, Outlie, Grdig Policies Homework d Slides Istructor: D Mssey Office hours: 2-3pm Tues d Wed Emil: mssey@cs.colostte.edu Techig Assistt: Willim Spriger Emil: wmsprig@cs.colostte.edu Grdig d Policies Grdig 10% Homework 30% Quizes 30% Midterm 30% Fil Grdig Policy No credit for lte homework. No exceptios. No credit for missed exms. No mke-up exms. Worklod Weekly Redig Assigmets Course will cover most of oth ooks Weekly Homework Assigmets Aville from course wesite y Fridy morig Due i lecture the followig Thursdy Exms Midterm + fil (comprehesive) I clss, closed ook, oe doule-sided chet sheet llowed 1

Admiistrtive You re resposile for kowig course, deprtmet, d uiversity policies READ THE SYLLABUS PROVIDES LINKS TO DEPT POLICIES Plgirism see defiitio http://writig.colostte.edu/guides/techig/ plgirism/ Coflict Resolutio we site http://www.coflictresolutio.colostte.edu/ Aout These Slides Slides Origilly Developed y Prof. Costs Busch (2004) My thks to Prof. Busch for developig the origil slide set. Adpted with permissio y Prof. D Mssey (Sprig 2007) Susequet modifictios Lguges A lguge is set of strigs Strig: A sequece of letters Exmples: ct, dog, house, Defied over lphet: Σ {,, c,, z} Alphets d Strigs We will use smll lphets: Strigs Σ { } u v w 2

Strig Coctetio w 1 2 v wv 1 2 m 1 2 1 2 m Strig Reverse w w R 1 2 2 1 Coctetio > Reverse > Strig Legth w 1 2 w Legth 4 2 1 Legth d Coctetio uv u + v u, u 3 v, v 5 uv 8 uv u + v 3 + 5 8 Does this prove the formul is true? C you prove the formul is true? 3

Empty Strig A strig with o letters: λ 0 Oservtios: λ λw wλ w λ λ Sustrig Susequece of cosecutive chrcters Strig Sustrig prefix λ Prefix d Suffix w uv suffix λ More Coctetio w ww w 0 w λ ( ) 2 0 ( ) λ 4

Σ Σ* Σ* The * Opertio Give lphet {, } { λ,,,,,,,,, } Σ Is the set of ll strigs over the lphet + Σ Σ Σ* Σ + The + Opertio Give lphet Is the set of ll strigs over the lphet mius Σ Σ + Σ* λ {, } { λ,,,,,,,,, } {,,,,,,,, } λ Give lphet: Σ Σ* Lguges A Lguge is y suset of Σ* {, } { λ,,,,,,,, } Some Lguges over this lphet iclude: { λ} {,, } { λ,,,,, } Lguges, Sets, d Nottios Sets Set size Set size Strig legth {} { λ} {} 0 { λ} 1 λ 0 5

λ A Ifiite Lguge L { : 0} L L Wht is the lphet ssocited with this lguge? Lguges d Opertios A lguge is set d set opertios pply {,, } {, } {,,, {,, } {, } { } {,, } {, } {, } } The Complemet of Lguge Ituitively, ll strigs ot i the lguge. More precisely: L Σ* L {, } { λ,,,,,, } Is ccc i the complemet of this lguge? L R Reverse R { w : w L} R {,, } {,, } L { : 0} L R { : 0} 6

L Coctetio { xy : x L y L } 1 L 2 1, 2 More Coctetio L LL L 0 L { λ} {,, }{, } {,,,,, } 0 {,, } { λ} 3 {, } {, }{, }{, } {,,,,,,, } {, } Str-Closure (Kleee *) 0 1 L * L L L 2 λ,,, *,,,,,,,, Is Our Nottio Sufficiet? Descrie lguge y listig ll the strigs i the lguge L 2 But this oly works for fiite lguges Descrie lguge y listig some ptter such s: L { : 0} m m { :, m 0} 2 L But this hs limits s well. Cosider the lguge of ll vlid Eglish seteces 7

Automt Fiite Automto Iput Strig Fiite Automto Output Strig Fiite Accepter Iput Strig Fiite Automto Output Accept or Reject iitil stte Trsitio Grph A -Fiite Accepter stte trsitio fil stte ccept 8

Iitil Cofigurtio Iput Strig Redig the Iput q 0 9

Iput fiished Output: ccept Strig Rejectio 10

Iput fiished The Empty Strig λ Output: reject q 0 11

Aother Exmple λ q 0, Output: reject Would it e possile to ccept the empty strig?,, 12

Iput fiished Output: ccept,, Rejectio,, 13

,, Iput fiished Which strigs re ccepted?, Output: reject Formlities M ( Q Σ, δ, q, F), 0 Determiistic Fiite Accepter (DFA) Q Σ δ q 0 F : set of sttes : iput lphet : trsitio fuctio : iitil stte : set of fil sttes 14

Iput Alphet Σ Σ { } Q Set of Sttes Q { q, q, q, q, q q } 0 1 2 3 4, 5 Iitil Stte Set of Fil Sttes F F { } q 4 q 0 q 4 15

Trsitio Fuctio δ δ : Q Σ Q δ ( q 0, ) q 1 q 1 δ ( q ) 5 0, q δ ( q ) 3 2, q 16

δ q 0 q 1 q 2 q 3 q 4 Trsitio Fuctio δ q5 q5 q5 q5 Exteded Trsitio Fuctio δ * δ *: Q Σ* Q ( q ) 2 δ * 0, q ( q ) 4 δ * 0, q q 2 17

( q 0, ) 5 δ * q Oservtio: There is wlk from with lel w δ * (, w) q q q to q q w q q 0 σ σ 2 w σ 1 σ 2 σ k 1 k q q σ Exmple: There is wlk from q 0 to with lel ( q ) 5 δ * 0, q Recursive Defiitio δ *( q, λ) q δ *( q, wσ ) δ ( δ *( q, w), σ ) w q σ q q 1 q 0 δ *( q, wσ ) q δ (, σ ) q δ *( q, wσ ) δ ( q, σ ) δ *( q, w) 1 δ *( q, wσ ) δ ( δ *( q, w), σ ) 18

δ δ δ δ δ q * (, ) ( δ * (, ), ) ( δ ( δ * (, λ), ), ) ( δ (, ), ) ( q, ) 2 1 Lguges Accepted y DFAs Tke DFA M Defiitio: The lguge L( M ) cotis ll iput strigs ccepted y M L ( M ) M { strigs tht drive to fil stte} Wht s Next Red Liz Chpter 1, Chpter 2.1-2.3 JFLAP Strtup, Chpter 1, 2.1 Next Lecture Topics from Chpter 2.1 d 2.2 Regulr Lguges NoDetermiistic Fiite Automt Homework 1 Due Thursdy 19