Indus Institute of Technology & Engineering
Computer Science & Engineering Department
=====================================
Formal Language and Automata Theory [CS0702]
Question Bank
1. Define the following terms in context of set theory and give example of
each:
a)Set
b)Subset
c)Complement
d)Set Difference
f)Negation
2. Define Relation. Properties of Relation.
3. Define function.
4. Explain one-to-one,bi-jection, composite and inverse function.
5. Explain principle of mathematical induction.
1² + 2² + 3² +...+ ² = ²=
−1 (2 +1)
6. =1 6
7. Let, f(n)=2 where n is natural number give recursive definition of
the function.
8. Define Regular language & Regular Expression.
9. Define Finite automata.
10. Define NFA and give one example.
11. Define DFA and give one example.
12. Find a string of minimum length in {0,1}* not in the language
corresponding to the regular expression: 1*(0+10)*1*
13. Find Regular expression for the following:
a) ∑={a,b,c} that represent all string of length 3.
b) All binary string with at least 3 characters and 3rd character
1
should be zero. (0+1)(0+1)0(0+1)*
c) String start with 0 and has odd length.
d) String start with 1 and has even length.
e) String ending with 1 and not contain 00.
f) Language of all string containing both 11 and 00 as sub string.
g) String that don’t end with 01.
h) String with odd number of 1’s.
14. Define Dead End State.
15. Draw Finite Automata for the following:
L1={x/x 00 is not substring of x, x ∈ {0,1}*}
L2={x/x ends with 01, x ∈ {0,1}*}
L3={x/x ends with 11, x ∈ {0,1}*}
16. Draw deterministic Finite Automata for the following:
L1={string start with a}
L2={string start with b}
17. Design FA which checks whether given binary number is even ,and
draw transition table.
18. Design FA which checks whether given unary number is divisible
by 3.
19. Define operation of DFA.
20. Draw NFA for the following :
a) The string with next to last symbol as 0.
b) The string with number of 0s and number of 1s are odd.
c) The string ending in 10 or 11.
d) The string corresponding to Regular expression {00}*{11}*
e) (a+b)*baaa
21. Compare DFA,NFA and NFA-^ .
22. Convert NFA to DFA for (01+1)*0.
2
23. Convert NFA - ^ to DFA
24. Explain Kleen’s Theorem.
25. Draw NFA-^ for following regular expression: (00+1)*(10)*.
26. Draw NFA-^ using Kleene’s theorem. (0 + 1)* (10+01)* 11.
28. For following find minimized DFA accepting same language.
29. Define pumping lemma and its application.
30. Use the pumping lemma to show that following language is not
regular: L = {ww|w ε {0,1}*}
31. Prove that the language L = { 0n : n is a prime number} is not
regular.
32. Use Pumping Lemma to show that following language is not regular.
L = { wwR /w ε {0,1}* }
33. Using Pumping Lemma prove that L = { | i ≥ 0} is not regular.
34. Write a shortnote on Deterministic Pushdown Automata.
35. Explain Left Recursion and Left Factoring.
36. Convert following CFG to Chomsky’s Normal Form.S→ aaaaS, S→ aaaa.
3
37. Draw PDA and design IDs for language L= { 0n 1m 0n | m,n>0 }
Simulate it for an input string ‘00011000’.
38. Construct CFG for following.
RE = (110 + 11)* (10)*
L ={ 0i 1j 2k / where j>i+k}
39. Convert the following grammar into Chomsky Normal Form.
G(V,Σ ,P,S) where V={S,A,B}, T={a,b}, S={S} and
P = { S → aB / bA, A→ a / aS / bAA, B→ b / aS / aBB }
39. Give difference between FA and PDA.
41. Eliminate left factoring form given grammar.
G: { S→ aSSbS / aSaSb / abb / b }
45. What is ambiguous grammar? See if following grammar is ambiguous
or not.
1)S→AB, A → aA / b, B → bB / a
2) S→S+S|a|b w=a+b+a
42. Construct Turing Machine for L= { an bn cn | n>0 }. Simulate this
TM over string ‘aaabbbccc’.
43. Construct Turing Machine to accept palindroms over ∑ { a, b }.
Simulate this TM over string ‘abababa’.
44. Simplify following Context Free Grammar:
G: {S→ ASB / ε , A → aAS / a, B→ SbS / A / bb}.
45. Explain Universal Turing Machine in detail.
46. Discuss difference between P class and NP class problem.
47. Construct Turing Machine for L= { an b3n | n>0 }.
48. Construct Turing Machine for L= { an b2n | n>0 }.
49. Construct Turing Machine to replace 111 with 011 in any given string.
50. Construct Turing Machine to concatenate two strings.
51. Construct Turing Machine to find 2’s complement of a binary
number.
52. Write a short note on simplification of grammars.
53. Eliminate left factoring form given grammar.
G: { S→ aSSbS / aSaSb / abb / b }