CS-501 · Theory of Computation/Unsolved PYQ Paper
CS-501 Theory of Computation - May 2023 Question Paper
Under each question, How to answer lists the points an answer should cover, outlined by CampusPrep from the syllabus. Check the details against your textbook.
-
14 MarksConvert the following Moore machine to Mealy.
- i)Moore machine (i) with states $q_0/0$, $q_1/1$ as shown in figure.
- ii)Moore machine (ii) with states $q_0/0$, $q_1/1$ as shown in figure.

How to answer
- Recall Moore to Mealy conversion rule: Mealy output on transition equals output of destination Moore state
- Transfer transitions for both machines (i) and (ii) with inputs a,b
- Draw Mealy transition diagram with output labels a/0, a/1 etc.
- Verify equivalence on sample strings
-
14 MarksaFor $\Sigma = \{a, b\}$, construct DFA's that accept the sets consisting of
- i)All the strings with exactly one 'a'.
- ii)All the string with atleast one 'a'.
- iii)All strings with atleast one 'a' and followed by exactly two b's.
How to answer
- Define DFA 5-tuple for each language
- Design states tracking count of a's (0,1,>1) and b's
- Draw transition diagrams for (i), (ii), (iii)
- Identify accept states
-
14 MarksDescribe the following sets by regular expression.
- i)Strings containing 1100 as substrings.
- ii)The set of all strings of 0's are 1's ending with 00. .........}.
- iii)$\{\Lambda, a, aa, aaa, aaaa, .....................$
How to answer
- Recall regular expression operators *, +, concatenation
- Write $(0+1)^*1100(0+1)^*$ for substring 1100
- Write $(0+1)^*00$ for ending with 00
- Write $a^*$ for {Lambda,a,aa,...}
-
7 MarksaExplain Arden's theorem and Pumping Lemma.
How to answer
- State Arden's theorem: R = Q + RP implies R = QP*
- Give assumptions and proof steps
- State pumping lemma for regular languages with |xy| conditions
- Explain use to prove non-regularity
-
7 MarksbWhat is Ambiguity? Explain taking any two examples.
How to answer
- Define ambiguity: grammar with two distinct parse trees/leftmost derivations
- Give example 1 with derivations and parse trees
- Give example 2 with derivations and parse trees
- Conclude ambiguous vs unambiguous
-
7 MarksaDesign a CFG.
- i)$L(G)= \{a^ib^jc^k \mid i \neq j \text{ (or) } j \neq k\}$
- ii)$L(G_I)= \{a^ib^{2i} \mid i \geq 0\}$
How to answer
- Recall CFG construction for unequal exponents using union
- Give productions for i!=j part and j!=k part
- Give productions S -> aSb | aA | bB style for a^i b^{2i}
- Verify with derivations
-
7 MarksbDefine a context free grammar with example.
How to answer
- Define CFG 4-tuple (V,T,P,S)
- Explain productions with example grammar
- Show derivation of sample string
- Show parse tree
-
7 MarksaExplain DPDA and NPDA with taking a suitable example.
How to answer
- Define DPDA: at most one move per configuration
- Define NPDA: multiple choices allowed
- Give example language for DPDA e.g. deterministic
- Give example requiring nondeterminism e.g. ww^R
-
7 MarksbExplain Recursively enumerable language and decidability.
How to answer
- Define recursively enumerable language via Turing machine acceptance
- Distinguish recursive vs RE languages
- Define decidability and decidable problem
- Give examples of decidable/undecidable
-
14 MarksDesign a Push down automata.
- i)$a^nb^{3n}, n \geq 1$
- ii)$ww^R, w \in (a, b)^2$
How to answer
- Define PDA 7-tuple and stack operations
- Design PDA for $a^nb^{3n}$ pushing 3 symbols per a
- Design NPDA for $ww^R$ guessing middle
- Give transition functions and diagrams
-
14 MarksWrite short notes on: (Any three)
- i)Halting problem
- ii)Turing machine
- iii)Chomsky Normal form
- iv)2 way DFA
How to answer
- Define each selected concept briefly
- Give formal definition / construction
- Give example / diagram where applicable
- Mention significance / application
Go to where you left off?
Quick Add to Notes
Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.
Create free accountHave an account? Log in
Notes Panel