Properties of Regular Languages
There are severe limits to the recognition
problems that an FA can handle. But this
requires proof.
Closure Properties
A set is closed under an operation if applying
that operation to any members of the set always
yields a
CS 3100 Models of Computation Fall 2010
September 9, 2010
Assignment 3, Handed out: September 9, 2010, Due: September 21, 10:30am
1. (Total 10 pts) Redo Problem 1.17, but by constructing a single DFA called D1And2 out of two DFAs D1
and D2 using the DFA i
CS 3100 Models of Computation Fall 2010
Assignment 4, Handed out: September 28, 2010
DUE OCT 7, 10:30am
1
PART-1: Experiments with Flex
At URL http:/flex.sourceforge.net/manual/, a manual for the lexical analyzer generator Flex is kept.
Read the section 4
Applications of Finite Automata
Applications of nite automata include string
matching algorithms, network protocols and
lexical analyzers
String Processing
Consider nding all occurrences of a short string
(pattern string ) within a long string (text strin
CS 3100 Models of Computation Fall 2010
Notes for Lecture 11 on Context-Free Grammars
1
What is a CFG?
A CFG is a compact description of a context-free language CFL.
Lets get some terminology straight: Grammar versus Language.
We have already seen it: Reg
0,1
Ans for 7,9
0
1
0,1
0,1
0
Ans for 8,10
1
0,1
0,1
Ans for 11
I
0,1
0
A
B
0
1
Ans for 15:postponed!
1
1
C
1
Q
F1
0
0
1
P
0
1
R
Ans for 12 : (0+1)* (0101+1101+0001+0110+0100) (0+1)*
Ans for 13 : Can obtain using JFLAP. Also see the following.
F2
0,1
0,1
CS 3100 Models of Computation Fall 2010
Notes 8, Posted online: September 16, 2010
These problems will be helpful for Midterm-1. More solutions will be worked out. The midterm exam itself
wont be this long! Many of the actual questions will be a subset of
Conversions Among FAs and REs
We describe algorithms that convert among
NFAs, DFAs and REs.
Kleenes Theorem Revisited
Surprisingly perhaps, nondeterminism does not
add to the power of a nite automaton:
Kleenes Theorem. The following are equivalent for a l
CS 3100 Models of Computation Fall 2010
August 26, 2010
Notes 2, Handed out: August 26, 2010 during Lecture 2
Review Ch1Slides.pdf
Do you follow these?
Tape, tape head, accepting state, rejecting state
State
Transition
Alphabet
What is the alphabet
Finite Automata
A nite automaton has a nite set of states with
which it accepts or rejects strings.
A Finite Automaton
An FA has three components:
1. input tape contains single string;
2. head reads input string one symbol at a time;
and
3. Memory is in o
CS 3100 Models of Computation Fall 2010
August 24, 2010
Notes 1, Handed out: August 24, 2010
General introduction
Tape, tape head, memory, transitions
JFLAP illustration
Strings accepted, language recognized
Examples from book
Alphabet, language, la
Regular Expressions
A regular expression describes a language using
three operations.
Regular Expressions
A regular expression (RE) describes a language.
It uses the three regular operations, called union/or ,
concatenation and star .
Brackets ( and ) are
CS 3100 Models of Computation Fall 2010
August 31, 2010
Assignment 2, Handed out: August 31, 2010, Due: 9/9, 10:30am
NOTE: Because of the Labor-day holiday Im giving you two extra days. This should not cause
you to put o this assignment!
Points given agai
CS 3100 Models of Computation Fall 2010
August 26, 2010
Notes 3, Handed out: August 31, 2010 during Lecture 3
Work out solutios for Assignment 1
Concept / mathematical notation practice: Write these mathematically:
Empty string
Empty set write this in
Nondeterministic Finite Automata
Nondeterminism gives a machine multiple
options for its moves.
Nondeterministic Finite Automata
In a nondeterministic nite automaton (NFA),
for each state there can be zero, one, two, or
more transitions corresponding to a
CS 3100 Models of Computation Fall 2010
August 31, 2010
Assignment 2 Solutions
Please ask if any of the answers are unclear.
1. (12 pts, 1.5 pts per string) Write out the shortest eight strings in the language cfw_a, bc in the order of
increasing length.
CS 3100 Models of Computation Fall 2010
Solution to Assignment 5
1. (10 points) 7.10(a)
Accepts 0, 00, 000, 11, 111, etc. Any sequence of 0s is accepted because it causes neither a push nor a
pop. Sequences of two or more 1s are accepted. For example, 111
CS 3100 Models of Computation Fall 2010
Notes for Lecture 17 10/26/10
Problem Solving, Programming, Algorithms
Computer scientists are supposed to be able to program solutions to problems. These solutions are, whenever
possible, required to be algorithms.
CS 3100 Models of Computation Fall 2010
Assignment 6 Handed out: October 19, 2010
DUE OCT 28, 10:30am
Background reading items for this assignment are kept on the class webpage against Week8, L15.
1. 35 points total
These problems help you obtain an appre
CS 3100 Models of Computation Fall 2010
Notes for Lecture 15 around Assignment 6 10/19/2010
Topics:
Reversing CFGs
Obtaining NFA from purely right-linear CFGs
Simplifying CFGs (also related to nullability discussed on Page 76)
Chomsky normal form
CFL
CS 3100 Models of Computation Fall 2010
Assignment 7 Handed out: October 26, 2010
DUE Nov 4, 10:30am
EXTRA CREDIT PARTS: DUE Nov 9th, 10:30am, via Electronic Handin
1. 10 points total: For this question on the CFL Pumping lemma, follow the instructions at
CS 3100 Models of Computation Fall 2010
Assignment 4 Solution
1
PART-1: Experiments with Flex
At URL http:/flex.sourceforge.net/manual/, a manual for the lexical analyzer generator Flex is kept.
Read the section 4. Some Simple Examples. Then read the sect
CS 3100 Models of Computation Fall 2010
Assignment 6 Handed out: October 19, 2010
DUE OCT 28, 10:30am
Background reading items for this assignment are kept on the class webpage against Week8, L15.
1. 35 points total These problems help you obtain an appre
CS 3100 Models of Computation Fall 2010
Assignment 45 Handed out: October 5, 2010
DUE OCT 19, 10:30am
1. (10 points) 7.10(a)
2. (5 points) 7.10(b)
3. (25 points), distributed as follows Build a PDA for the language described in Problem 6.6(b)
(a) (5 point
CS 3100 Models of Computation Fall 2010
Practice Midterm-2
This being a practice test, there are more longer answer questions and lesser multiple-choice questions than in
the real exam.
1
Multiple Choice (Closed Book), 30 points
You earn 2 points for each
CS 3100 Models of Computation Fall 2010
Notes for Lecture 20 11/04/10
The book denes sets using cfw_ x : p(x), while we dene using cfw_ x | p(x). The same thing.
Change of perspectives wrt languages
Mostly we talked about languages having a syntactic str