Practice Exam 1
1. The SouthEastern regional climate center,
http:/www.dnr.state.sc.us/climate/sercc/, has historical weather data from
many weather stations. Here is some sample data for the Chapel H
54(34%204# # 3 ! R 3 44(& 5# R c !9)94 5# % Q 14 q 4 $ !&% # ! ` Q d S
5
#
xw
$ 7 f d by
$R
R
94 3&0# 5# 3 ! R & 5# R c !9)9 5# 4% Q 4 q 49 $ 44# ! u Q d S
5
%
xw
$ 7 f d by !%$
R
14rt f @ 9 $
1
Push-down Automata and Context-Free
Languages
Lemma 1.1 (3.4.1) The class of languages recognized by push-down automata is the same as the class of context-free languages.
This result is interesting
COMP 455
Models of Languages and Computation
Fall 2017
Homework 6
Due Tuesday, October 31, 2017
1. Show that the following grammar is ambiguous:
S AU
S VC
U BC
V AB
Aa
Af
Bb
Cc
Cg
where upper case let
COMP 455
Models of Languages and Computation
Spring 2017
Homework 1
Due Tuesday, August 29, 2017
1. Problem 1.1.1, parts (a), (c), (e), (g) from the text, page 8.
2. Problem 1.1.2, parts (a), (c), and
COMP 455
Models of Languages and Computation
Spring 2017
Quiz 3
Dont forget to write your name on the quiz sheet.
True or false:
1. aa cfw_a
15. aa cfw_a
2. ab cfw_a
16. ab cfw_acfw_b
3. ba cfw_acfw_b
COMP 455
Models of Languages and Computation
Spring 2017
Homework 2
Due Tuesday, September 5, 2017
1. Problem 1.7.5, part (d), from the text, page 46. Note that in this
problem u can depend on w. Give
COMP 455
Models of Languages and Computation
Fall 2017
Homework 3
Due Tuesday, September 12, 2017
1. Construct a deterministic finite automaton recognizing the following
language: cfw_w : w has at lea
COMP 455
Models of Languages and Computation
Spring 2017
Pop Quiz 4
Dont forget to write your name on the quiz sheet.
1. True or false:
(a) If M is a finite automaton, then L(M ) is regular.
(b) If M
COMP 455
Models of Languages and Computation
Fall 2017
Homework 9
Due Date Thursday, November 30, 2017
1. Problem 4.6.1 (a), from the text, page 232.
2. Problem 5.2.1 (a), from the text, page 250. Be
COMP 455
Models of Languages and Computation
Fall 2017
Homework 5
Due Tuesday, October 10, 2017
1. Problem 3.1.2, from the text, page 120, except that you should give a
derivation of the string abbabb
Introduction to COMP 455
My name
This is COMP 455, Models of Languages and Computation
Pass out sign-up sheet
Ask who is sophomore etc. and what majors people have
Show course web page, go over l
1
Nondeterministic Finite Automata
Suppose in life,
whenever you had a choice, you could try both possibilities and live
your life.
At the end, you would go back and choose the one that worked out t
1
Alphabets and Languages
Look at handout 1 (inference rules for sets) and use the rules on some examples like
cfw_a cfw_a
cfw_a cfw_a, b,
cfw_a cfw_a,
cfw_a cfw_a,
cfw_a cfw_a, b,
a cfw_a,
a cfw_a, b
1
Finite Representations of Languages
Languages may be infinite sets of strings. We need a finite notation for them.
There are at least four ways to do this:
1. Language generators. The language can b
1
Showing Languages are Non-Regular
Question: How can one show that a language is not regular?
We have no way to do this so far; constructing a finite automaton or a
regular expression can only show
COMP 455
Models of Languages and Computation
Fall 2017
Homework 8
Due Tuesday, November 21, 2017
1. Problem 4.1.1, parts (a) and (b), from the text, page 191. For part
(a), start in the configuration
COMP 455
Models of Languages and Computation
Fall 2017
Homework 7
Due Tuesday, November 14, 2017
1. Problem 3.5.1 (a), from the text, page 148. Hint: Try expressing this
language as the union of two o
COMP 455
Models of Languages and Computation
Spring 2017
Pop Quiz 6
Thursday, March 23, 2017
Dont forget to write your name on the quiz sheet.
1. True or false:
(a) The context free languages are clos
COMP 455
Models of Languages and Computation
Spring 2017
Pop Quiz 5
Tuesday, March 7, 2017
Dont forget to write your name on the quiz sheet.
1. True or false:
(a) If L has finitely many equivalence cl
COMP 455
Models of Languages and Computation
Spring 2016
Homework 5
Due Monday, March 7, 2016
1. Problem 3.1.2, from the text, page 120, except that you should give a
derivation of the string abbabbaa
1
Deterministic Finite Automata
S*
0,1
0,1
0,1
0,1
0,1
0,1
Finite Automaton
Finite Internal States
Device with Binary Inputs
One Binary Output
0,1
0,1
Device with Multiple
Inputs and Outputs
A nite au
1
Nondeterministic Finite Automata
Suppose in life,
whenever you had a choice, you could try both possibilities and live
your life.
At the end, you would go back and choose the one that worked out t
1
Finite Automata and Regular Expressions
Motivation: Given a pattern (regular expression) for string searching, we
might want to convert it into a deterministic nite automaton or nondeterministic nit
1
Minimizing Finite Automata
Outline of this section:
1. Dene strings equivalent with respect to a language L. This is
notated as x L y. This is dened by x L y i cfw_z : xz L =
cfw_z : yz L. If L is r
1
Parse Trees
Parse trees are a representation of derivations that is much more compact.
Several derivations may correspond to the same parse tree. For example, in
the balanced parenthesis grammar, th
1
Context-Free Grammars
Context-free languages are useful for studying computer languages as well
as human languages.
Context-free languages are recongnized by push-down automata (PDA)
in the same wa
1
Push-down Automata
A push-down automaton is a nite automaton with an additional last-in
rst-out push-down stack; anything read from the stack is immediately destroyed. Push-down automata are partway
1
Minimizing Finite Automata
Outline of this section:
1. Dene strings equivalent with respect to a language L. This is
notated as x L y. This is dened by x L y i cfw_z : xz L =
cfw_z : yz L. If L is r