Sample Questions AUTOMATA
Sample Questions AUTOMATA
Long Questions
1. Convert the given grammar into a GNF compliant grammar: S→SS | (S) | a
2. Convert the given grammar into a CNF compliant grammar: S → aA | a; A → aBB | ε; B → Aa | b;
3. Consider a grammar with the rules: 𝑆 → 𝑎𝑆𝑎 | 𝑏𝑆𝑏 | 𝑎 | 𝑏 . Draw a derivation tree for the string
‘𝑎𝑎𝑏𝑏𝑏𝑎𝑏𝑎𝑏𝑏𝑏𝑎𝑎’
4. Consider a grammar with the rules: 𝑆 → 𝑎𝑆𝑏 | 𝑆𝑆 |𝜆. Draw the leftmost derivation tree for the string
‘𝑎𝑎𝑏𝑎𝑎𝑏𝑏𝑎𝑏𝑏’
5. Consider a grammar with the following rules: 𝑆 → 𝑎𝑆𝑏 | 𝑏𝑆𝑎 | 𝜆. Draw a derivation tree for the string
‘𝑎𝑏𝑎𝑎𝑏𝑎𝑎𝑏𝑏𝑎𝑏𝑏𝑎𝑏’
6. Consider a grammar with the rules: 𝑆 → 𝐴𝐵; 𝐴 → 𝑎𝐴 | 𝜆; 𝐵 → 𝑏𝑏𝐵 | 𝜆. Draw the leftmost derivation tree for
the string ‘𝑎𝑎𝑎𝑏𝑏𝑏𝑏𝑏𝑏’
7. The transition table of a DFA is shown in Figure 2. Compute step by step, the
acceptance (or rejection) of the string 01001011.
8. The transition table of a DFA is shown in Figure 2. Compute step by step, the
acceptance (or rejection) of the string 01001001.
9. Design a DFA that accepts all strings of 0’s and 1’s, that either begins or ends (or
both) with 01.
10. Design a DFA that accepts all strings of 0’s and 1’s, that either begins or ends (or
both) with 00.
11. A grammar has the productions: G : S → aS1b | λ; S1 → bSa. Find the language generated by this grammar.
12. Create an NFA for accepting decimal numbers characterised by:
a. It should accept an optional +, - sign in the beginning
b. Followed by a string of digits
c. Then a decimal point
d. Followed by another string of digits
e. Either of the two above mentioned strings may be empty but not both.
13. Convert the NFA given in Figure 3, to the equivalent DFA using subset construction method.
24. This machine is used for computing integer subtraction. Show the
computation of 3 – 1, step by step.
Figure: 5
25.
a. Describe the Chomsky hierarchy of languages.
b. Prove that the set of Context Free languages are closed under
i. Union
ii. Concatenation, and
iii. Kleene closure
26.
a. Define a context sensitive grammar
b. Design a context sensitive grammar to accept any strings of the form 𝑎𝑛 𝑏 𝑛 𝑐 𝑛
c. Use the grammar designed above to generate the string 𝑎2 𝑏 2 𝑐 2
27.
a. Define Diagonalization Language
b. Prove that Diagonalization Language is not a Recursively Enumerable Language.
28. Draw the transition table of a Turing Machine with ‘Storage in State’ extension that will recognize strings of the
form (01* + 10*). Compute the steps to accept (or reject) the string 100.
29. Consider the context-free grammar: 𝑆 → 𝑎𝑆𝑎 | 𝑏𝑆𝑏 |𝑐
a. Convert this grammar to the equivalent GNF compliant grammar
b. Draw the parse tree for generating the string 𝑎𝑏𝑎𝑎𝑐𝑎𝑎𝑏𝑎
c. Convert this grammar to the equivalent PDA and write down the transition rules
Consider the context-free grammar: 𝑆 → 𝑎𝑆𝑎 | 𝑏𝑆𝑏 |𝑐
d. Convert this grammar to the equivalent GNF compliant grammar
e. Draw the parse tree for generating the string 𝑎𝑏𝑎𝑎𝑐𝑎𝑎𝑏𝑎
f. Convert this grammar to the equivalent PDA and write down the transition rules
26. Prove that the set of Recursively Enumerable language is closed under compliment operation.
27. Prove that if 𝐿 is a Recursively Enumerable language and 𝐿̅ is also a Recursively Enumerable language, then 𝐿
is a Recursive language.
28.
a. Define the coding scheme of a Turing Machine
b. Compute the code of the machine M = ({q0, q1, q2}, {0, 1}, {0, 1, B}, 𝛿, q0, {q2}, {L, R}) where the
transitions rules are
i. 𝛿(𝑞0, 0) = (𝑞1, 0, 𝑅)
ii. 𝛿(𝑞1, 1) = (𝑞0, 1, 𝑅)
iii. 𝛿(𝑞0, 𝐵) = (𝑞2, 𝐵, 𝑅)
iv. 𝛿(𝑞1, 𝐵) = (𝑞2, 𝐵, 𝑅)
29. Prove that the set of Context Free languages is not closed under intersection and complementation.
30. Explain NPDA and DPDA with transition function.
31. Are expressive powers of NPDA and DPDA same? Explain with proper example.
32. Prove that the set of regular languages is closed under union and intersection.
33. Describe types of Turing machine.
34. Write importance of Oracle Turing machine.
35. Turing recognizable languages are closed under union and complementation. Explain.