Lecture notes on automata, languages, and grammars
February 6, 2012
These lecture notes are intended as a supplement to Moore and Mertens The Nature of Computation, and
are available to anyone who wants to use them. Written solut
Solutions for all problems in the book.
3. See book solution
5. We will reduce the halting problem to problem A, i.e. deciding
whether or not a machine halts on all inputs. This will show that
problem A is undecidable (i.e. th
Problem 4: Solution in the book.
S -> aABB | aAA,
A -> aBB | a,
B -> bBB | A
We first need to convert the grammar to Griebach Normal Form. In
this case, the only rule that is not in the proper form is the unit
production B -> A.
Homework 6 Solutions:
Note that below when writing a grammar, we will often use the shorthand to
denote rules with the same left-hand-side. For example,
A -> aA
A -> lambda
will be denoted by
A -> aA | lambda
We use the following ascii notation below:
Homework 2 Solutions
(q0 , 1010) = cfw_q0 , q2
(q1 , 00) =
L = cfw_ababn : n 0 cfw_aban : n 0
Find an nfa with three states that accepts the language
L = cfw_ an : n 1 cfw_
Homework 3 Solutions
October 24, 2013
Since no alphabet was specied we will perform the construction for both the
alphabet = cfw_a and alphabet = cfw_a, b.
For = cfw_a we get,
where S0 = cfw_q0 and S012 = cfw_q0 , q1 , q2
Homework 1 Solutions
Let L be any language on a non-empty alphabet. Show that L and L cannot
both be nite.
There are two possible cases: 1) when L is innite, and 2) when L is nite.
The rst case is trivial since if L is innite then it is by de