You are on page 1of 1

Theory of Computation

Assignment

1. Show that (a*+b) and (a+b)* defines the same language over the alphabet {a, b}.
2. Describe the language for the following regular expression:
i. bba*(a+b)
ii. ((a+b)a)*
iii. (a+b)*ab(a+b)*
iv. (a(a+bb)*)*
3. Write regular expression for the languages accepting all words that
i. contain at least one of the strings ‘aba’ or ‘bbbb’
ii. end in ‘aa’ or ‘bb’
iii. have an odd number of a’s
iv. even number of a’s and odd number of b’s
v. have b’s occurring in clumps of an odd number at a time such as abaabbbab, ab.
vi. have no two consecutive a’s
4. Build a DFA that accepts the language of all strings of length 4 or more such that next-to-last
letter is equal to the second letter of the input string.
5. Construct DFA that accepts only those strings that have ‘abab’ as substring.
6. Let ∑={a, b}. Construct DFA accepting each of the following languages:
i. All string in ∑* where each ‘a’ is immediately followed by a ‘b’.
ii. All string in ∑* with odd number of a’s and even number of b’s.
7. Design a DFA for all strings that either starts with ‘ab’ or ends with ‘ba’.
8. Build a DFA that accepts only those words that have even numbered occurrences of substring
‘ab’.
9. For the following pairs of regular language, build a finite automata and regular expression
that define L1 Ո L2:
L1: (ab*)* L2 : a(a+b)*
10. Give the full details of the following Turing Machines:
>L L and >L R
11. Using bypass algorithm, convert the following transition graph into a regular expression:
ab ba
-
a
bb abb
λ +
a,b

12. Find context free grammar for the language defined by the regular expression (baa+abb)*
13. Find a Context Free Grammar (CFG) for a language of the form axbyaz where x, y,
z=1,2,3..and x+z =y
14. Design a Turing Machine for finding the two’s complement of a given number which is
provided as input to it in binary form over the alphabet {0, 1}.
15. Design left shifting Turing Machine S← which transforms UwU, where w contains no blanks,
into wU.
16. Design right shifting Turing Machine S→ which transforms UwU, where w contains no
blanks, into UUwU.

You might also like