2 Problem Sheet Two
2 Problem Sheet Two
COMPUTATION
Problem Sheet 2
Problem 1 : A transducer is an FSM with output. Read from any book about Mealy
and Moor machines and prepare a writeup.
Problem 2 : The two’s complement of a binary string, representing a positive integer,
is formed by first complementing each bit, then adding one to the lowest order
bit. Design a transducer for translating bit strings into their two’s complement,
assuming that the binary numbe is represented as is with lower order bits at the
left of the string.
Problem 3 : Let a1 a2 ... be an input bit string. Design a transducer that computes
the parity of every substring of three bits. Design a transducer that computes
the parity of every substring of three bits. Specifically, the transducer should
produce output
truncated(L) = {truncate(w) : w ∈ L}
Show how, given a DFA for any regular language L, one can construct a DFA for
truncate(L). From this, prove that if L is a regular language not containing λ,
then truncate(L) is also regular.
Problem 13 : Show that if L is regular, so is LR .
Problem 14 : Let L be any language. Define even(w) as the string obtained by
extracting from w the letters in even numbered positionsl that is, if
w = a1 a2 a3 a4 ...
then
even(w) = a2 a4 ...
even(L) = {even(w) : w ∈ L}
Show that the family of regular languages is closed under this operation.
Problem 19 :Define an operation third on strings and the language as
third(a1 a2 a3 a4 a5 a6 ...) = a3 a6 ..
with the approprate extension of this definition to languages. Prove the closure
Figure 1:
Show that the family of regular languages is closed under the shuffle operation.
Problem 23 :Define an operation 5 on a language L as the set of all strings of L
with the fift symbol from the left removed (stringsof length less than five are
left unchanged). Show that the family of regular languages is closed under the
minus5 operation.
Problem 24 : Let G1 and G2 be two regular grammars. Show how one can derive
regular grammars for the languages L(G1 ) ∪ L(G2 ), L(G1 )L(G2 ), and L(G1 )∗
from G1 and G2 .
Problem 25 : Describe informally the languages accepted by the deterministic finite
automata shown in the next page.
Figure 2: