Beruflich Dokumente
Kultur Dokumente
For all the problems below it is not sufficient just to give a solution. Justify your
answers. At the final exam unexplained answers will be granted 0 points. (For
example, assume that you are constructing an automaton for a given language.
Then you should also explain that the automaton indeed accepts the language).
It is allowed to discuss the exercises with others, but you are supposed to
solve each exercise individually. It is absolutely not allowed to copy solutions from
others.
Your solutions should be handed in to your tutorial assistant Jonas Wallgren
or Johannes Schmidt at a lecture or a tutorial or by using the Post till IDA
postbox in front of Java Cafe in building B, or by sending a PDF file by email
to him. Your solutions can be written in Swedish or English.
|| y = {y},
x || = {x},
xa || yb = (x || yb){a} (xa || y){b}.
{ab} || {cd, e} = {abe, aeb, eab, abcd, acbd, acdb, cabd, cadb, cdab }.
1
(a) What is L = (01) || (10) ? Give NFAs for the languages (01)
and (10) . Using them construct an NFA for (01) || (10) .
(b) Show that if L1 , L2 are regular languages then so is L1 || L2 . Do
this by describing a general method of constructing an NFA for
L1 || L2 out of NFAs for L1 and L2 .
Hint from the textbook: Put a pebble on a machine for L1 and
one on a machine for L2 . Guess nondeterministically which pebble
to move. Accept if both pebbles occupy accept states.
(c) Applying standard methods construct a minimal DFA for L.
(d) Consider the equivalence relation RL on (thus RL )
defined by: xRL y if and only if for all z , xz L iff yz L.
What is the index (the number of equivalence classes) of RL ?
Describe precisely at least one of the equivalence classes of RL (by
giving an automaton, regular expression, etc, or in words).
(r + s) r + s
r r (r + s) (r s )
rr r r (r + s) (r s)
r(sr) (rs) r (r + s) (r s) r
2
initial state s and one new final state f , with -transitions from s to
the initial states of N , N , and from the final states of N , N to f .
Another idea would be to glue together both initial states of N , N
into a single state. (The same may be done with the final states of
N , N .) Find out whether this idea is correct. In other words, does it
produce an automaton which accepts the language L(N ) L(N )?
5. Which of the following languages are regular? In each case give a
construction/proof to justify your claim.
Hint: Be clever. You are not required to construct an automaton or a
regular expression for each regular language below. And in some cases this
may require really too much work.
6. (Optional: solving this problem you may skip one of the items of the
previous problem). Prove that the set of programs of your favourite
programming language is not regular.
Hint: To make the proof manageable, you may use a homomorphism h
which maps the programming language onto some simple language L .
Construct h in such a way that L is not regular and that this fact is
easy to prove. It may be convenient if h maps most of the symbols
into .