Next: About this document
- (10 pts.) Construct a Turing machine that copies a string of zeros
over a one, that is,
where
is the initial state and
is the final state.
(You may use a tape alphabet of 4 symbols, say
.)
- (5 pts.) Given the deterministic finite automaton defined by the
transition table below,
find an equivalent minimal state finite automaton.
(State
is the final state.)

The initial partition is

The second partition is

The transition table of the minimal state machine is (state 2 is the final state):

- (5 pts.) Convert the following context-free grammar into Chomsky
normal form.

First make each production of the form
or

Next make each production of the form
into the form

Short Answer Questions:
Answer each of the following questions in a sentence or two.
Try to use your own words rather than direct copying from the text or notes.
Each correct answer earns 5 points.
- What is the pumping lemma for context-free languages and for what
purpose is it usually used?
If
is a context-free language, then there exists a natural number
such
that if
and
, then
can be written in the
form
where
and
for all
.
- When is a grammar in Greibach normal form?
If all productions have the from
where
- When is a grammar ambiguous?
If some word in the language has two different derivation (parse) trees
- What is a derivation (parse) tree?
(1) A parse tree is a tree where every vertex has a label from
, (2) the root is labeled
, (3) interior vertices are
labeled with variables, (4) If vertex labeled
has children
labeled
, then
is a production in the grammar, and (5) if
is the label of
a node then the node is a leaf and is the only son of its father.
- What is the universal language and why is it called ``universal''?
- What is the Chomsky hierarchy?
- What is the Church-Turing hypothesis and what implications does it have?
Every computable function is a partial recursive function, or every
computable language is recursively enumerable.
- What does Rice's theorem state and what does it mean?
Any nontrivial property of the recursively enumerable language is
undecidable. A property is trivial if no languages satisfy it or
if all languages satisfy it.
- What is the
-closure of a state
?
It is the set of all states reachable from
by following lambda
transitions.
- Algorithmically construct a finite automaton for the regular expression
True and False Questions:
Place a T next to the statement if it is true and an F otherwise.
Each correct answer earns 2 points.
- T 1.
- If string
is accepted by a nondeterministic
finite state automaton, then it is accepted by some deterministic finite state automaton.
- F 2.
- If string
is accepted by a nondeterministic pushdown automaton,
then it is accepted by some deterministic pushdown automaton.
- F 3.
- Nondeterministic Turing machines can accept more languages than
deterministic Turing machines.
- F 4.
- The complement of every context-free language is context-free.
- F 5.
- The productions
can be used in a context-free grammar.
- F 6.
- Every context-free language can be derived from some grammar that is
not ambiguous.
- T 7.
- Regular languages are closed under intersection.
- F 8.
- DFA's use a stack to store information.
- F 9.
- Every language can be recognized by a Turing machine.
- F 10.
- If
and
are regular expressions then
- T 11.
- Moore and Mealy machines are finite automata with output.
- T 12.
- If
is a move for
a Turing machine
,
then
could occur in
's computation.
- F 14.
- The universal language is recursive.
- T 15.
- A recursive language is recognized by some Turing
machine that halts on all input.
- If string
is accepted by a nondeterministic
finite state automaton, then it is accepted by some deterministic finite state automaton.
- If string
is accepted by a nondeterministic pushdown automaton,
then it is accepted by some deterministic pushdown automaton.
- The complement of every context-free language is context-free.
- The productions
can be used in a context-free grammar.
- Every context-free language can be derived from some grammar that is
not ambiguous.
- Regular languages are closed under intersection.
- Nondeterministic Turing machines can accept more languages than
deterministic Turing machines.
- DFA's use a stack to store information.
- Every language can be recognized by a Turing machine.
- If
and
are regular expressions then
- Moore and Mealy machines are finite automata with output.
- If
is a move for
a Turing machine
,
then
could occur in
's computation.
- The set of all strings with an equal number of 0's
and 1's is regular.
- The universal language is recursive.
- A recursive language is recognized by some Turing
machine that may not halt on all input.
What is the pumping lemma for regular languages and how is it often used?
If
is a regular language, then there exists a natural number
such
that if
and
, then
can be written in the
form
where
and
for all
.
Fall 1992
CS 5083 Quiz 1
Name:
- (8 pts.) Let
denote the real numbers. Define a relation
for all
by:
if and only if
is an integer.
Show that
is an equivalence relation.
-
is reflexive: for all real numbers
,
since
in an integer.
-
is symmetric: if
and
are real numbers and
, then
in an integer. It follows that
is an integer, so
.
-
is transitive: if
and
for real numbers
then
and
are integers. Thus
is
an integer and
.
Since the relation
is reflexive, symmetric and transitive,
is an
equivalence relation.
- (8 pts.) Find the transitive closure of the relation
- (5 pts.) Show that the complement of a recursively enumerable language
need not be recursively enumerable.
(Hint: Use the fact that there are languages that are
recursively enumerable, but not recursive and a theorem proved in class.)
Suppose that the complement
of a recursively enumerable language
is recursively enumerable. Then by a theorem proved in class,
and
are recursive. Since there are languages that are recursively
enumerable but not recursive, there must be recursively enumerable
languages whose complements are not recursively enumerable.
- (7 pts.) Given the transitions below for a Turing machine
with
final state
and the string
show the sequence
of instantaneous descriptions as the machine processes the string.
Is
in the language of the machine?

Since we halt in the final state
, the string
.
- (7 pts.) Use primitive recursion to define the exponential function
.
(You may use the fact that the product function prod is recursive.)
First, notice that
,
that is, the sucessor composed with the zero function yields
for all
natural number
.
Next, notice that
Thus,

- (15 pts.) Define a function
from the natural numbers N
to
(the strings over
), by

In general, for
, let

- a)
- Show by induction on the length
of a string
that if
, then
.
- b)
- Show by induction on the length
of a string
that if
, then there exists a natural number
such that
.
- c)
- What can be concluded about the set
?
- a)
- Let
, so that
.
If
then
.
Assume that if
then
for all words
of length
or less.
Let
. Then
or
where
has length
.
If
then there exists a
such that
.
So
and
by the inductive hypothesis.
Thus
is a one-to-one function.
- b)
- Let
, so that
and
.
Assume that for all words
of length
or less there
is a natural number
such that
.
Let
. Then
or
where
has length
. By the inductive hypothesis, there
exists
such that
and
for some power
.
If
, let
so that
.
If
, let
so that
.
Thus
is a onto function.
- c)
- The set of all strings over 0 and 1 is countably infinite;
it has the cardinality of the integers.
Fall 1992
CS 5083 Quiz 2
Name:
- (10 pts.) Show how to construct a nondeterministic finite automaton with
transitions that accepts all strings represented
by the regular expression

- (10 pts.) Given the following nondeterministic finite automaton,
show how to construct an equivalent deterministic finite automaton.


denotes accept (final) states.
- (10 pts.) Given the following nondeterministic finite automaton
with
transtions, find an equivalent nondeterministic
finite automaton without
transitions.

Note that
-closure
and
-closure
, thus

Similarly,

Continuing for the other states, we find:

- (10 pts.) Show that the language
is not regular.
Suppose that
is regular, let
be the integer of the pumping
lemma, and let
.
By the pumping lemma
can be decomposed as
where
,
and
for all natural numbers
.
Now
for some
and
for some
. Thus,
has length
.
We want to show that this length can not be a factorial
for all natural numbers
. Consider
.
We have
which has length
,
and
where the last strict inequality is true for all
.
Since a one state machine could not recognize the language,
the langugage must not be regular.
- (10 pts.) Given the following deterministic finite automaton,
with final states
and
,
find the first three partitions generated by the
state minimazation algorithm.

The initial partition is

The second partition is

The third partition is
Next: About this document