Skip to content
Visva-Bharati · Department of Mathematics

MMO-41(P3)

Theory of Computation-II
M.Sc. Mathematics · Semester IV2018
  1. 1(a) Define a grammar $G$ and the language generated by $G$.\par Consider a grammar $G=\langle\{S,C\},\{a,b\},P,S\rangle$,\par where $P=\{S\to aCa;\ C\to aCa\mid b\}$.\par Compute $L(G)$, the language generated by $G$.
  2. 1(b) Let $L$ be the set of all palindromes over $\sum=\{a,b\}$. Construct a grammar $G$ generating the language $L$. [2]
  3. 1(c) Define a recursive set. Show that a context-sensitive language is recursive. [4]
  4. 2(a) Define a regular expression. Construct a minimal state finite automation equivalent to the regular expression $\left(a^*+b^*\right)abb$.
  5. 2(b) Define a regular set. Construct a regular grammar $G$ generating the regular set $a^*b(a+b)^*$.
  6. 2(c) Show, by using Pumping lemma for regular set, that the set $L=\left\{ww\mid w\in\{a,b\}^*\right\}$ is not regular. [2]
  7. 3(a) Define Chomsky Normal Form of a Context-Free Grammar. Reduce the following grammar $G=\langle\{S,A,B\},\{b,c\},P,S\rangle$, where $P=\{S\to ASA\mid bA,\ A\to B\mid S,\ B\to c\}$ to Chomsky Normal Form.
  8. 3(b) Is it possible for a regular grammar to be ambiguous? [2]
  9. 3(c) A Context-Free Grammar is defined by the productions $S\to a\mid Sa\mid bSS\mid SSb\mid SbS$. Show that every string in $L(G)$ has more a's than b's. [2]
  10. 3(d) Show that $L=\{a^p\mid p\text{ is a prime}\}$ is not a Context-Free language. [2]
  11. 4(a) Define a push-down automaton. Construct a push-down automaton $A$, accepting the set of all strings over $\{a,b\}$ with equal number of a's and b's.
  12. 4(b) Consider the following grammar for arithmetic expression\par \hspace*{2em}$E\to E+T\mid T$\par \hspace*{2em}$T\to T*F\mid F$\par \hspace*{2em}$F\to(E)\mid id.$\par Construct a predictive parsing table and write down the moves by a predictive parser on input $id+id*id$. [5]
  13. 5(a) Define a Turing machine.\par Design Turing machines\par \hspace*{1em}i)\enspace that copies strings of 1's and ;\par \hspace*{1em}ii)\enspace that accepts $\{0^n1^n\mid n\ge1\}$. \par\hfill P.T.O. \begin{center}( 2 )\end{center}
  14. 5(b) Consider a Turing machine described by the following table:\par \begin{center}\begin{tabular}{l|c|c|c} Present states $\backslash$ Input & $\not\! c$ & $\blank$ & 1\\\hline $\to(q_1)$ & $\not\! c\,Rq_1$ & --- & $\blank\,Rq_2$\\ $q_2$ & --- & --- & $\blank\,Rq_1$ \end{tabular}\end{center} Generate the type-0 grammar that corresponds to the Turing machine. [3]
  15. 6(a) Define regular function and partial recursive function over $\mathbb N$. Show that $f(x)=\frac x2$ is a partial recursive function over $\mathbb N$.
  16. 6(b) Explain Turing model for computation. Design a Turing machine for computing the successor function.