0% found this document useful (0 votes)
60 views8 pages

Toc QB

This document is a question bank for the Theory of Computation course (3160704) prepared for the year 2025 by Prof. Ruchit Shah and Prof. Shivani Doshi. It includes various questions categorized into units covering topics such as mathematical theory, regular languages, finite automata, context-free grammar, and pushdown automata. Each question is associated with specific marks and course outcomes, indicating their relevance to the curriculum.

Uploaded by

Daksh Parmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views8 pages

Toc QB

This document is a question bank for the Theory of Computation course (3160704) prepared for the year 2025 by Prof. Ruchit Shah and Prof. Shivani Doshi. It includes various questions categorized into units covering topics such as mathematical theory, regular languages, finite automata, context-free grammar, and pushdown automata. Each question is associated with specific marks and course outcomes, indicating their relevance to the curriculum.

Uploaded by

Daksh Parmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Theory of Computation (3160704)

Question Bank

Year: 2025

Prepared by:

Prof. Ruchit Shah

Prof. Shivani Doshi


Question Bank
Text Book: Introduction to Languages and the Theory of Computation, 4th by John
Martin, Tata Mc Graw Hill

UNIT- 1 : Review of Mathematical Theory Marks CO


1. Write regular expressions For Binary numbers that are multiple of 2. (W 24) 3 CO1
2. Prove “There must be a prime number between n and n!”. (W-22) 4 CO1
3. Define: Set, Subset, and Complement. (S-22) 3 CO1
4. Write and explain the principle of mathematical induction using example. (S-22) 4 CO1
5. Define one-to-one, onto and bijection function (W-21) (S-21) 3 CO1
6. The given relation R on set A= {1, 2, 3} determine whether the Relation is reflexive, 4 CO1
symmetric or transitive, give reason. R ={(1,1), (1,2), (1, 3),(2,1), (2, 2), (3, 1),(3,3)}
(W-21)
7. Write Principle of Mathematical Induction. Prove that for every 7 CO1
n ≥ 1, 1 + 3 + 5 + … + (2n - 1) = n^2 (W-21) (S-21)
8. Explain reflexivity, symmetry, and transitivity properties of relations 4 CO1
9. What is PMI? Prove 7+ 13+19+…..+(6n+1)= n(3n+4) using PMI 7 CO1
𝑛(𝑛+1)(2𝑛+1)
10. Prove ∑𝑛 𝑖2 = using PMI. 7 CO1
𝑖=1 6

11. Consider a Relation R = {(a, b), (a, a), (b, b), (c, c), (d, d), (b, a)} on set A = {a, b, c, 4 CO1
d}. Is relation R an equivalence relation? Explain in detail.
UNIT- 2: Regular Languages and Finite Automata
1. Write down 5-tuple definition for the finite automata. Construct the minimal finite 7 CO2
automata over Σ = {a, b} for the following languages.
L1 = {Where all the strings start and ends with different symbol}
L2 = {Where every string has odd occurrences of “ba”} (W-22)
2. State the difference between NFA and DFA. (W 24) 3 CO2

3. Construct the Moore machine that counts the no. of occurrences of substring “bba” 7 CO2
over Σ = {a, b}. Now convert this Moore machine into Mealy machine. Show the
transition table and transition diagram for both the machines. (W-22)
4. Define the steps to convert ε-NFA into NFA. Then convert the following 7 CO2
ε-NFA into NFA. (W-22)

5. Construct the regular expressions for the following languages. (W-22) 4 CO2
L1 = {Where the no. of ‘a’ is odd}, Σ = {a,b}

TOC (3160704) Page 2


SAL Education
L2 = {Where every string starts with ‘0’ and of even length}, Σ = {0,1}

6. Draw Finite automata for following regular expression: (S-22) 7 CO2


(i). (0+1)∗(1 + 00)(0+1)∗
(ii). (111+100)∗0
7. Explain Regular language & Regular expressions(S-22) 3 CO2
8. Find a regular expression corresponding to each of the following subsets of {0,1}* 4 CO2
(i). the language of all strings that do not end with 01
(ii). the language of all strings that begin with or end with 00 or 11 (S-22)
9. Prove Kleene’s theorem part-1(S-22) (W-21) 7 CO2
10. Explain procedure to minimize finite automata (S-22) 7 CO2
11. Define Regular grammar and give example. (S-22) 3 CO2
12. Define FA and Write recursive definition of NFA (W-21) 3 CO2
13. Find a regular expression of following subsets of {0, 1}* 4 CO2
1. The language of all strings that begin or end with 00 or 11.
2. The language of all strings ending with 1 and not containing 00 (W-21)
14. Draw Finite Automata to accept following over input alphabets Σ ={0, 1} 7 CO2
(i) The language accepting strings not ending with ’01’.
(ii) The language accepting strings next to last symbol ‘0’ (W-21)
15. Let M1 and M2 be the FAs pictured in Figure, recognizing languages L1 and L2 7 CO2
respectively. (W-21)

Draw FAs recognizing the following languages.


a. L1 U L2
b. L1 - L2
16. Give the difference between Moore machine and mealy machine. (W-21) 3/4 CO2
17. Convert NFA- Λ to FA for following figure. (W-21) 7 CO2

18. Design and mealy machine that gives output 1 if input of sequence abb comes, other 4 CO2
wise 0 (W-21)
19. Find minimum state FA for following figure (W-21) 7 CO2

TOC (3160704) Page 3


SAL Education
20. Using Kleene’s Theorem Draw NFA-Λ for ((0+1)*10 + (00)*)* (W-21) 4 CO2
21. Define DFA and NFA and NFA- Λ (S-21) (W-21) 3/4 CO2
22. Write Regular Expressions corresponding to each of the following subsets of {0,1}* 4 CO2
(i) The language of all strings containing both 101 and 010 as substrings.
(ii) The language of all strings that do not end with 01. (S-21)
23. Using constructive approach determine NFA- Λ for the regular expression 4 CO2
(0 + 1)*1(0 + 1). (S-21)
24. Draw FA for accepting: The strings with odd no of 1’s and odd no of 0’s. (S-21) 4 CO2
25. What are the applications of regular expressions and finite automata? (S-21) 3 CO2
26. Minimize the DFA shown in Fig: (S-21) 7 CO2

27. Write Kleene’s Theorem part-I, Any regular language can be accepted by a finite 7 CO2
automation (S-21)
28. Give recursive definitions of the extended transition functions, δ* for DFA and NFA 3 CO2
(S-21)
29. Convert following NFA- Λ to NFA(S-21) 7 CO2

30. Find regular expression for following 3 CO2


I. Language of all strings containing exactly two 0’s.
II. Language of all strings that begins or ends with 00 or 11.
31. Draw Finite Automata (FA) for following languages: 7 CO2
L1 = {x / 00 is not a substring of x }
L2 = {x / x ends with 01 }
Find FA accepting languages (i) L1 ∩ L2 and (ii) L2 – L1

TOC (3160704) Page 4


SAL Education
32. Define NFA – Λ. Explain how to convert NFA – Λ into NFA and FA with suitable 7 CO2
example.
33. Draw FA for each of the following RE. 3 CO2
(a+b)*baaa
34. Construct a Mealy machine to find 2’s complement of a given binary number. Assume 7 CO2
that given binary number is presented from LSB to MSB. Also, convert the resultant
Mealy machine into its equivalent Moore machine.
35. Construct a Regular expression from the following finite automata. 4 CO2

UNIT- 3: Context free grammar (CFG)


1. Define type 2 grammar with example. (W-22) 3 CO3
2. Define: CNF. Show the steps to convert CFG into CNF. Convert the following CFG 3 CO3
into equivalent CNF. (W-22)
S→TU
T → 0T1 | ε
U → 1U0 | ε
3. Explain ambiguous and unambiguous context free grammar with example. (W-22) 7 CO3

4. Define Context free grammar & context free language (S-22) 3 CO3
5. Write CFG for following (S-22) 4 CO3
(i) L={aibjck | i=j or j=k}
(ii) L={aibjck | j>i+k}
6. Convert following CFG to CNF : S -> S(S)/^ (S-22) 7 CO3
7. Construct a CFG for set of strings that contain equal number of a’s and b’s over ∑ = 4 CO3
{a,b}. (W 24)
8. Convert following CFG to CNF : (S-22) 7 CO3
S->aX/Yb X->S/ ε Y->bY/b
9. Give the difference between top down and bottom up parsing. (S-22) 4 CO3
10. Define Ambiguous grammar. For following grammar say whether the grammar is 3 CO3
ambiguous or not. give reason S-> ABA, A->aA| ε , B->bB|ε (W-21)
11. Give an unambiguous grammar for SIMPLE CALCULATOR contain +, -, *, /, (,) 4 CO3
operator for terminal ‘id’. And draw a parse tree for (id+id)*id-id (W-21)
12. Find the CFG for the regular expression : (01*1 + 1)* (01)* (W-21) 3 CO3
13. Given the context-free grammar G, find a CFG G’ in Chomsky Normal Form. (W-21) 7 CO3
S -> AaA | CA | BaB
A -> aaBa | DC
B -> bb | aS
C -> Ca | bC | D
D -> bD | Λ
14. Define grammar and Chomsky hierarchy. (W-21) (S-21) 3 CO3
15. Convert the CFG, G ({S,A,B},{a,b},P , S) to CNF , where P is as follows (S-21) 7 CO3
S → aAbB

TOC (3160704) Page 5


SAL Education
A → Ab | b
B → Ba | a
16. Convert the Mealy machine shown in given figure into Moore machine (S-21) 7 CO3

17. Define CFG. When is a CFG called an ‘ambiguous CFG’? (S-21) 3 CO3
18. Consider following grammar: (S-21) 7 CO3
S → ASB | Λ
A → aAS | a
B → SbS | A | bb
i. Eliminate useless symbols, if any.
ii. Eliminate Λ productions.
19. For the following CFG, Find Chomsky normal form 7 CO3
S→AACD
A→aAb|ᴧ
C→ aC|a
D→aDa|bDb|ᴧ(W-21)
20. Consider the grammar: 7 CO3
S→aAS | a
A→ SbA | SS | ba
Derive left most and right most derivation of string aabbaa using given grammar. (W-
21)
21. Define CFG. Create CFG for (011+1)*(01)* (W-21) 3 CO3
22. Explain Ambiguous Grammar and remove ambiguity with suitable example. (W-21) 4 CO3
23. Define Context Free Grammar. Find context-free grammar for the language: L=
{aibjck | j=i+k} (W-21)
UNIT- 4 : Pushdown Automata, CFL And NCFL
1. Enlist closure properties for the context sensitive language. (W-22) 3 CO4
2. Define pumping lemma for context free language. 4 CO4
Show that the language L= {ww / w ∈{a,b}*} is not context free language
using pumping lemma theory. (W-22)
3. What is a pushdown automaton? Explain (S-22) (W-21) (S-21) 3 CO4
4. Design and draw deterministic PDA Accepting “Balance string of brackets” (S-22) 7 CO4
5. Explain deterministic pushdown automata. (S-22) 3 CO4
6. Explain conversion from PDA to CFG. (S-22) 4 CO4
7. Design and draw PDA to accept string with more a’s than b’s. (S-22) 7 CO4
8. State pumping lemma for regular languages (W-21)(S-21) 3 CO4
9. Design a PDA to accept L = {xcy | x, y∈ (a, b)* and |x| = |y|}. (W-21) 4 CO4
10. Design a PDA to accept L = {anbn | n>=0}. (W-21) 4 CO4
11. Convert the following grammar to a PDA: (S-21) 7 CO4
I → a | b | Ia | Ib | I0 | I1

TOC (3160704) Page 6


SAL Education
E → I | E * E | E + E | (E)

12. For the language L = { xcxr | x → {a,b}* } design a PDA(Push Down Automata). (S- 4 CO4
21)
13. Design PDA for L={x∈xr/x∈{a,b}*}. The string in L are odd length palindromes over 7 CO4
{a,b}.
14. Write a note on DPDA and NPDA 4 CO4
15. Design a deterministic PDA Accepting “Balance string of brackets”. 7 CO4
16. Design a PDA for given CFG. 7 CO4
S→XY
X→AX|BX | a
Y→YA |YB| a
A→a
B→b
17. Construct PDA for L={𝑎2𝑛𝑏𝑛| 𝑛 > 0} 7 CO4
18. Convert the given PDA to CFG. 7 CO4
∂(q0,a,z0)→(q0,xz0)
∂ (q0,a, x) → (q0,xx)
∂ (q0,b,x) → (q1,ε)
∂ (q1,b,x) → (q1, ε)
∂ (q1, ε,z0) → (q1, ε)

UNIT- 5 : Turing Machine (TM)


1. Write down 7-tuple definition for the Turing machine. Construct the Turing machine 7 CO4
and its transition table over Σ = {a,b} for the language L = {a^nb^n / n>=1}. (W-22)
2. Discuss universal Turing machine with example. (W-22) (S-21) 4 CO4
3. Enlist and explain the operations performed by tape in Turing machine. (W-22) 3 CO4
4. What is Turing machine? Explain its capabilities. (S-22) 3 CO4
5. Explain Church Turing thesis. (S-22) (S-21)(W-21) 4 CO4
6. Design a Turing machine to copy a string. (S-22) (S-21) 7 CO4
7. Explain Universal Turing machine (S-22) (W-21) 4/7 CO4
8. Design a Turing machine with no more than three states that accepts the language 7 CO4
a(a+b)*. Assume ∑ = {a,b} (W 24)
9. Develop a Turing Machine to accept palindromes over {a,b}* (W-21)(S-21) 7 CO4
10. Develop a Turing Machine to accept the language L = {X / Na(X)=Nb(X) , 7 CO4
X ∈ {a,b}*} (W-21)
11. What is Turing Machine? Write advantages of TM over FSM. (S-21)(W-21) 3 CO4
12. Design a TM for accepting Palindromes for odd and even length. 7 CO4
13. Enlist limitations of Turing machines. 3 CO4
14. Design a Turing machine for the language 7 CO4
L = {𝑎𝑛𝑏𝑚𝑐𝑛| 𝑛, 𝑚 > 1}
15. Design a TM to perform multiplication of two unary numbers. 7 CO4
UNIT- 6 : Computable Functions
1 Describe: Recursive function. Prove that every recursive function is computable. (W- 7 CO5
22)

TOC (3160704) Page 7


SAL Education
2 What is minimization? Explain with suitable example. (W-22) 4 CO5
3 State the following functions: Partial, Constant and Total. (W-22) 3 CO5
4 Explain Primitive Recursive Functions. (S-22) 3 CO5
5 Explain post correspondence problem. Consider the post correspondence system 7 CO5
described by the following lists. A={ 10,01,0,100,1}, B ={101,100,10,0,010}Does
this PCP have a resolution?
Unit 7: Undecidability
1 Explain in detail: Class P and Class NP. (W-22) 4 CO5
2 Define the following terms: Recursive language, and Recursive Enumerable Language. 3 CO5
(W-22)
3 Discuss Post’s Correspondence Problem with example. (W-22) 3 CO5
4 Define P, NP, NP-Hard and NP-Complete problem? 4 CO5
5 Explain Halting Problem with suitable example. 7 CO5
6 Mention the difference between decidable and undecidable problems. (W 24) 4 CO5

TOC (3160704) Page 8


SAL Education

You might also like