0% found this document useful (0 votes)
30 views60 pages

Toc QB Even 2023

Uploaded by

Yash Patel
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)
30 views60 pages

Toc QB Even 2023

Uploaded by

Yash Patel
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/ 60

L.J.

Institute of Engineering & Technology Semester: VI (2022-23)

Subject Name: Theory of Computation


Subject Code:3160704
Faculty: Ms. Poonam Patel, Ms. Rupal Raviya

UNIT NO- 1 :
Review of Mathematical Theory
TOPIC:1: Sets, Functions, Logical statements, Proofs, relations,
languages
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
Define: Set [LJIET] 01

Answer: A set is a group or collection of objects or numbers, considered as an entity


1
unto itself. Sets are usually symbolized by uppercase, italicized, boldface letters such as
A, B, S, or Z. Each object or number in a set is called a member or element of the set.
Give True or False: [LJIET] 01
2
If A ⊆ B and B ⊆ C then A ⊆ C.(True)
Define: One-One Function [LJIET] 01
3 Answer: The function is injective (one-to-one) if every element of the co-domain is
mapped to by at most one element of the domain. An injective function is an injection.
Give True or False: [LJIET] 01
4
If x ∈ A and A ⊆ B then x ∈ B.(True)
If n(A) = 110, n(B) = 300, n(A – B) = 50 then find n(A ∪ B) [LJIET] 01
Answer: n(A – B)=n(A)-n(A п B)
50=110- n(A п B)
5 n(A п B)=60
Now, n(A ∪ B)=n(A)+n(B)- n(A п B)
=110+300-60
n(A ∪ B)=350
Classify the following relations as reflexive, sym-metric, transitive or their combinations: 01 for each
1 R = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 3), (1, 3)} on the set A = {1, 2, 3} [LJIET]
Answer: Reflexive and Transitive
6
(b) R = {(3, 3), (6, 6), (9, 9), (12, 12), (6, 12), (3, 9),(3, 12), (3, 6)} on the set A = {3, 6,
9, 12} [LJIET]
Answer: Reflexive only
Define: Onto function [LJIET] 01

Answer: The function is surjective (onto) if every element of the co-domain is mapped
7
to by at least one element of the domain. (That is, the image and the co-domain of the
function are equal.) A surjective function is a surjection.
8 Define: Bijection Function [LJIET] 01

Theory Of Computation (3160704) 2022-2023 Page 1


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Answer: The function is bijective (one-to-one and onto or one-to-one correspondence) if


every element of the co-domain is mapped to by exactly one element of the domain.
(That is, the function is both injective and surjective.) A bijective function is a bijection.
Define: Equivalence Relation [LJIET] 01

Answer: A Relation between elements of a set which is reflexive, symmetric, and


9
transitive and which defines exclusive classes whose members bear the relation to each
other and not to those in other classes.
Sr. DESCRIPTIVE QUESTIONS Marks
No
Prove that ( square root of 2 ) is irrational by method of Contradiction. [Jan-2013- 3
1
OLD ][Dec-2013-OLD] [LJIET]
2 Explain Equivalence Relation.[May-2011-OLD ][Dec-2013-OLD] [LJIET] 3
Answer the following:[Dec-2014] [LJIET] 3.5
3 (i) Given the relation R in A as R={(1,1), (2,2), (2,3), (3,2), (4,2), (4,4)} is R (a) reflexive
(b) symmetric (c) transitive? (d) antisymmetric?
Answer the following. 3.5
4 (i) What is meant by “one to one” and “onto” function? Check whether function f: R -→
R+, f(x) = x2 is one to one and onto.[Dec-2015-OLD] [LJIET]
Define one-to-one, onto and bijection function. Check whether the function f: R -→ R+, 4
5
f(x) = x2 is one to one or onto.[Jan 2013-OLD] [LJIET]
Explain one-to-one, onto and bijection function with suitable example.[Dec-2013-OLD] 4
6
[LJIET]
7 Prove that √2 is Irrational by method of Contradiction.[Dec-2015-OLD] [LJIET] 7
Define onto function. In each case, a relation on the set {1, 2, 3} is given. Of the three 4
properties, reflexivity, symmetry, and transitivity, determine which ones the relation has.
Give reasons.
8
a. R = {(1, 3), (3, 1), (2, 2)}
b. R = {(1, 1), (2, 2), (3, 3), (1, 2)}
c. R = ϕ .[May-2018-OLD] [LJIET]
In the given relation determine the properties( reflexivity, symmetry, transitivity), which 2
9
ones the relation has: R = {(1,1),(2,2),(3,3),(1,2)} and R = Ø.[June-2013-OLD] [LJIET]
10 Define One-to-one and Onto Functions. Also explain Compositions and Inverse of 7
functions. [May-2014-OLD,May-2016] [LJIET]
11 Let A = {1, 2, 3, 4, 5, 6} and R be a relation on A such that aRb if a is a multiple of b. 7
Write R. Check if the relation is i) Reflexive ii) Symmetric iii) Asymmetric iv)
Transitive.[Oct-2016-OLD] [LJIET]
12 Define relation. Define reflexive and transitive relation. A binary relation R on NxN is 7
defined as (a,b)R(c,d) if a ≤ c or b ≤ d. Prove that R is reflexive but not transitive. [May-
2016-OLD] [LJIET]
13 Using proof by contradiction, prove √3 is Not a rational number. [May-2016-OLD] 7
[LJIET]
14 Explain following 7
1 One to one and onto function
ii. Properties of equivalence relation [Oct-2016-OLD ][ NOV-2018-OLD] [LJIET]
15 Explain one-to-one, onto and bijection function with suitable example. [May-2017- 7
OLD] [LJIET]
16 Explain equivalence relation with example. [May-2017-OLD] [LJIET] 7
Theory Of Computation (3160704) 2022-2023 Page 2
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

17 Define relation. Define reflexive and transitive relation. A relation R is given as 7


R={(0,0),(1,1),(2,2),(3,3),(3,1),(1,0),(0,1),(1,3)}. Prove that R is reflexive, symmetric but
Not transitive. [Nov-2017-OLD] [LJIET]
18 Define onto and one-to-one functions. [May-2017-OLD] [LJIET] 2
19 Define reflexivity, symmetry, and transitivity properties of relations. OR Explain 3,4
reflexivity, symmetry, and transitivity properties of relations. [May-2017-OLD] [Nov-
2018-OLD] [Nov-2021-OLD][LJIET]
20 Consider the relation R = {(1,2), (1,1), (2,1), (2,2), (3,2), (3,3)} defined over {1, 2, 3}. Is 3
it reflexive? Symmetric? Transitive? Justify each of your answers. [May-2017-OLD]
[LJIET]
21 Draw truth table for following logic formula: (¬P V ¬Q). Is it a tautology? A 3
contradiction? Or neither? Justify your answer. [May-2017-OLD] [LJIET]
22 Define one-to-one, onto and bijection function. [Nov-2017-OLD][ Nov-2018- 3
OLD][Nov-2021-NEW] [LJIET]
23 Check whether the function f: R+ → R, f(x) = x2 is one to one and onto. [Nov-2017- 4
OLD] [LJIET]
24 Explain equivalence relation with example. [Nov-2017-OLD] [LJIET] 7
25 Define one-to-one, onto and bijection function. Check whether the function f: R+ → R, 4
f(x) = x2 is one to one and onto. [May-2011-OLD] [LJIET]
26 Prove by Contradiction that for any sets A, B and C, if A∩B = Ø and C⊆B, then A∩C 2
=Ø. [May-2018-OLD] [LJIET]
27 Define bijection function. Explain Compositions and Inverses of Functions. [May-2018- 3.5
OLD] [LJIET]
28 Prove that the statements: (p v q) → r and (p → r) v (q → r) are logically equivalent. 3
[NOV-2018-OLD] [LJIET]
29 Define reflexivity, symmetry, and transitivity properties of relations. Consider the relation R 7
= {(1, 2), (1,1), (2,1), (2,2), (3,2), (3,3)} defined over {1, 2, 3}. Is it reflexive? Symmetric?
Transitive? Justify each of your answers. [May-2019-OLD] [LJIET]
30 Explain one to one and onto functions with example. Give inverse of the function f: R+ → R+ 7
, f(X) = X² [Dec-2019-OLD] [LJIET]
31 Out of these two statements which one is true and which is false. Justify your answer. 4
1. ∀𝑥(∃𝑦((𝑥 − 𝑦)2 < 4 ))
2. ∃𝑦(∀𝑥((𝑥 − 𝑦)2 < 4 )) [Oct-2020-OLD] [LJIET]
32 Define – Equivalence relation. A relation on the set {1, 2, 3} is given as R={(a,b) | a−b is an 4
even no}. Check whether R is equivalence relation or not. Give reasons. [Dec-2019-OLD]
[LJIET]
33 Let relation R = {(a,b) : a + b = 10 and a, b ∈ N}. Decide whether R is an equivalence 4
relation or not. Justify your answer with proper reason. [Jan-2021-OLD] [LJIET]
34 The given relation R on set A= {1,2,3} determine whether the 4
Relation is reflexive, symmetric or transitive, give reason.
R ={(1,1), (1,2), (1, 3),(2,1), (2, 2), (3, 1),(3,3)} [Nov-21_New][LJIET]
35 Define bijection. Decide and justify whether the function f : N → N defined by f(n) = n2 4
is bijection or not. [Jan-2021-OLD] [LJIET]
36 Define One-to-one and Onto Functions. Also explain Compositions and Inverse of 4
Functions. [Jan-2021-OLD] [LJIET]
37 What is a proposition? Which logical connectives do we use to generate compound 3
proposition? [Oct-2020-OLD] [LJIET]
38 Define onto, one-to-one, and bijection functions. [Aug-2021-OLD][LJIET] 3
39 Explain on to, one to one, and Bijection Function with suitable example. [Nov- 3
Theory Of Computation (3160704) 2022-2023 Page 3
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

2021OLD][LJIET]
40 Explain proposition, compound proposition and logical connectives. [Dec-2022- 7
OLD]LJIET]
41 Explain reflexivity, symmetry, and transitivity properties of relations. [Dec-2022- 4
OLD]LJIET]
42 Using principle of Mathematical Induction, prove that for every n >=1, 7
7 + 13 + 19 + …. + (6n + 1) = n(3n + 4) [Dec-2022-OLD]LJIET]
43 Define the following functions: one-one, on-to, and inverse. [Dec-2022-NEW] [LJIET] 3
44 Prove “There must be a prime number between n and n!” [Dec-2022-NEW][LJIET] 4
45 Answer the following: [Jun-2022-OLD][LJIET] 4
In each case, say whether the statement is tautology, a contradiction or neither and
in case of neither find a simpler statement that is logically equivalent.
1> (𝑝 → 𝑞)⋀(𝑝 → ¬𝑞)
2> 𝑝 ⋁ (𝑝 → 𝑞)
46 Answer the following: [Jun-2022-OLD][LJIET] 3
In each case, a relation on the set {1,2,3} is given. Of the three properties,
reflexivity, symmetry and transitivity, determine which ones the relation has. Give
reasons.
1> R = {(1,3),(3,1),(2,2)}
2> R = ((1,1),(2,2),(3,3),(1,2)}
3> R = ø
47 Define Equivalence Relation. [Jun-2022-OLD][LJIET] 3
48 Define one-to-one function. Justify whether the function f : R → R+ 4
defined by f(n)=n2 is bijection or not[Jun-2022-OLD][LJIET]
49 Define: Set, Subset, Complement[Jun-2022-NEW][LJIET] 3
TOPIC:2:Mathematical induction, strong principle, Recursive
definitions
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 Define Induction principle. [LJIET] 01
Answer: • Basis step:
P(1) is true.
• Assume p(k) is true.
• P(K+1) is shown to be true.
2 Define: Recursive Function [LJIET] 01
Answer: A recursive function is a function which either calls itself or is in a potential
cycle of function calls. As the definition specifies, there are two types of recursive
functions. Consider a function which calls itself: we call this type of recursion immediate
recursion.
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Give the recursive definition of PAL of Palindrome over any alphabet Σ.[May-2011- 4
OLD] [LJIET]
2 Answer the following:[Dec-2014-OLD] [LJIET] 7
Given the relation R in A as R={(1,1), (2,2), (2,3), (3,2), (4,2), (4,4)}
(ii) Show that 2n > n3 for n >10 by Mathematical Induction.
3 Answer the following. 3.5
(ii) What do you mean be recursive definition? Give the recursive definition of
Palindrome. [Dec-2015-OLD] [LJIET]
4 Using Principle of Mathematical Induction, prove that for every n >= 1, 7
Theory Of Computation (3160704) 2022-2023 Page 4
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

7 + 13 + 19 + . . . + (6n + 1) = n(3n +4) [Dec-2015-OLD] [LJIET]


5 Using Principle of Mathematical Induction, prove that for every n >= 1, 7
n
Σ i = n (n+1) / 2
i=0 [May-2011-OLD] [LJIET]
6 Using Principle of Mathematical Induction, prove that for every n >= 1, 7
7 + 13 + 19 + . . . + (6n + 1) = n(3n +4) .[May-2011-OLD] [Dec-2013-OLD] [LJIET]
7 Define Mathematical Induction and prove the following: For every n ≥ 0,[May-2012- 7
OLD] [MAY-2018-OLD] [LJIET]

8 Using Principle of Mathematical Induction, Prove that For every n >= 1.[Jan 2013- 7
OLD] [LJIET]
n
Σ i2 = n (n+1)(2n+1)/ 6
i=1
9 Define the Strong Principle of Mathematical Induction. Prove the following using 7
mathematical Induction.[May-2014-OLD] [LJIET]
7+ 13 + 19 + ………+ (6n+1) = n (3n+4)
10 Answer the following: [Dec-2014-OLD] [LJIET] 7
(i) Give recursive definition of each of the following sets.
a. The set T of positive integer divisible by 2 or 7.
b. The set U of all string in {0,1}* containing the substring 00.
(ii) Prove that for any every n>=0,n(n2+5) is divisible by 6.
11 Define Mathematical Induction Principle and Prove that for every n ≥ 0, [May-2015- 7
OLD] [LJIET]
N
Σ i = n (n+1) / 2
i=0
12 Define Mathematical Induction Principle and Prove that for every n ≥ 1, 7
n
Σ i2 = n (n+1)(2n+1) / 6
i=1
[May-2016] [May-2019-OLD] [LJIET]
13 Use the principle of mathematical induction to prove that 7
1 +3 +5 + … +r = n² for all n>0 where r is an odd integer & n is the number of
terms in the sum. ( Note : r= 2n-1).[Oct-2016-OLD] [LJIET]
14 Define mathematical induction. [May-2016-OLD] [LJIET] 7
Prove that if 0 < a < 1 then (1-a)n ≥ 1 – na.
15 Define Mathematical Induction principle and prove that for any n>=4, n!>2n. [Oct- 7
2016-OLD] [LJIET]
16 Using Principle of Mathematical Induction, prove that for every n >= 1 7

OR
State the principle of mathematical induction and prove by mathematical
induction that for all positive integers n 1+2+3+……..+n = n (n+1)/2.
Theory Of Computation (3160704) 2022-2023 Page 5
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

OR
Prove 1+2+3+…+n =(n*(n+1)) / 2 using Principal of Mathematical Induction. [May-
2017-OLD][ Nov-2017-OLD][Nov-2018-OLD][Dec-2019-OLD] [LJIET]

17 Prove that √2 is Irrational by method of Contradiction. [Dec-2015-OLD][ May-2017- 7


OLD] [Nov-2017-OLD] [LJIET]
18 State proof by contradiction. [Nov-2017-OLD] [LJIET] 2
19 Prove that √2 is an irrational number. [Nov-2017-OLD] [LJIET] 5
20 Define weak principle of mathematical induction. Using Mathematical induction prove 7
that 1+2+3+…+n = n*(n+1)/2 [Nov-2017-OLD] [LJIET]
21 Give recursive definition of a tree. [May-2017-OLD] [LJIET] 3
22 Give the definition of “Transitive Closure of a relation” using Induction. [June-2013- 2
OLD] [LJIET]
23 Find the transitive closure and the symmetric closure of the relation 2
{ (1,2), (2,3), (3,4), (5,4) } [May-2018-OLD][LJIET]
24 Give recursive definition for the language L which is the set of all integers (positive 2
and negative) divisible by 7. [May-2018-OLD][LJIET]
25 State the strong principle of mathematical induction and show how will you give proof 4
by induction? [NOV-2018-OLD][LJIET]
26 Give recursive definition for Language Pal of palindromes. [NOV-2018-OLD][LJIET] 3
27 Write Principle of Mathematical Induction. Prove that for every n ≥ 1, 7

OR
Write the principle of Mathematical Induction. Prove using mathematical induction that
for every n≥0,

(Consider the sum on the left is 0 for n = 0) [May-2018-OLD][ Dec-2019-


OLD][LJIET]
28 Prove by mathematical induction: for every n>=1, 1 + 3 + 5 + … + (2n – 1) = n2[May-2019- 4
OLD][Nov-2021-NEW][LJIET]
29 Write the strong principle of mathematical induction and show that 𝑃(𝑛) is true for every𝑛 ≥ 3
2, where 𝑃(𝑛) is the statement: n is either a prime or a product of two or more primes. [Oct-
2020-OLD][LJIET]
30 Define – bijection function. Check whether the function 𝑓∶𝑍 →𝑍 defined by 𝑓(𝑥)=2𝑥 is a 3
bijection function or not. Justify your answer. [Dec-2019-OLD][LJIET]
31 Using the principle of mathematical induction, for all n > 0, prove that, 7
1 × 2 + 3 × 4 + 5 × 6 + . . . . . + (2n − 1) × 2n = (𝑛 (𝑛 + 1) (4𝑛 − 1) ) / 3
[Jan-2021-OLD][LJIET]
32 Answer the following: [Jan-2021-OLD][LJIET] 3
Define Mathematical Induction Principle and Prove that for every n ≥ 1,
n
Σ i2 = n (n+1)(2n+1) / 6
i=1
33 Use the principle of mathematical induction to prove that 7

Theory Of Computation (3160704) 2022-2023 Page 6


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

1 +3 +5 + … +(2n-1) = n2 , for all n>0 where r is an odd integer & n is the number of
terms in the sum. [Aug-2021-OLD][LJIET]
34 What is PMI? Prove 7+ 13+19+…..+(6n+1)= n(3n+4) using PMI. [Nov-2021- 7
OLD][LJIET]
35 What are quantified statements? Write a quantified statement which says that: 7
“Everybody has to go through some difficulty for some time”. [Dec-2022-OLD][LJIET]
36 State the strong principle of mathematical induction and prove that all integers 7
bigger than 2 have prime factorizations [Dec-2022-OLD][LJIET]
37 Define Primitive Recursive Functions. [Dec-2022-OLD][LJIET] 3
38 Write Principle of Mathematical Induction. Prove that for every n ≥ 0, 7
0+1+2+3+......+n = n(n+1)/2[Jun-2022-OLD][LJIET]
39 Write and explain the principle of mathematical induction using 4
example. [Jun-2022-NEW][LJIET]
UNIT NO- 2 :
Regular Languages and Finite Automata
TOPIC:1:Regular expressions, regular languages, applications,
Automata with output-Moore machine, Mealy machine, Finite
automata, memory requirement in a recognizer, definition, union,
intersection and complement of regular languages.
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 What is the difference between the strings and the words of a language? [LJIET] 01
Answer: A string is any combination of the letters of an alphabet where as the words of
a language are the strings that are always made according to certain rules used to define
that language.
2 What is Null String (Λ) ? [LJIET] 01
Answer: The string with zero occurrences of symbols (letters) from ∑.
3 There are ________ tuples in finite state machine.(5) [LJIET] 01
Explanation: states, input symbols, initial state, accepting state and transition function.
4 Number of states require to accept string ends with 10. [LJIET] 01
a) 3
b) 2
c) 1
d) can’t be represented.
Answer: b
5 Finite automata requires minimum _______ number of stacks.(0) [LJIET] 01
6 FSM with output capability can be used to add two given integer in binary 01
representation. Give True or False.(True) [LJIET]
7 Define Regular Expression? [LJIET] 01
Answer: Regular Expression is the generalized form of any regular language through
which you can construct any string related to that language.
8 Differentiate between (a,b) and (a+b)? [LJIET] 01
Answer:
(a, b) = Represents a and b.
(a + b) = Represents either a or b.
9 Define: Mealy Machine [LJIET] 01
Answer: A Mealy Machine is an FSM whose output depends on the present state as well
as the present input.
Theory Of Computation (3160704) 2022-2023 Page 7
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

It can be described by a 6 tuple (Q, ∑, O, δ, X, q0) where −


Q is a finite set of states.
∑ is a finite set of symbols called the input alphabet.
O is a finite set of symbols called the output alphabet.
δ is the input transition function where δ: Q × ∑ → Q
X is the output transition function where X: Q → O
q0 is the initial state from where any input is processed (q0 ∈ Q).
10 Define: Moore Machine [LJIET] 01
Answer: Moore machine is an FSM whose outputs depend on only the present state.
A Moore machine can be described by a 6 tuple (Q, ∑, O, δ, X, q0) where −
Q is a finite set of states.
∑ is a finite set of symbols called the input alphabet.
O is a finite set of symbols called the output alphabet.
δ is the input transition function where δ: Q × Σ → Q
X is the output transition function where X: Q × Σ → O
q0 is the initial state from where any input is processed (q0 ∈ Q).
11 Define FA [LJIET] 01
Answer: A finite automaton (FA) is a simple idealized machine used to recognize
patterns within input taken from some character set (or alphabet) C. The job of an FA is
to accept or reject an input depending on whether the pattern defined by the FA occurs in
the input.
12 Regular expression for all strings starts with ab and ends with bba is? [LJIET] 01
Answer: ab(a+b)*bba
13 Is the following set regular [LJIET] 01
{02n | n >=1}
If yes, write down the corresponding regular expression. Else, prove that the language is
not regular.
Answer: Yes. (00)+
14 The basic limitation of finite automata is that 01
a) It can’t remember arbitrary large amount of information.
b) It sometimes recognize grammar that are not regular.
c) It sometimes fails to recognize regular grammar.
d) All of the mentioned [LJIET]
Answer: a)
15 Specify True or False: Deterministic Finite Automata are strictly weaker class than Non- 01
deterministic Finite Automata (NFAs),i.e., there exists a language that is accepted by an
NFA but is not accepted by any DFA.(False) [LJIET]
16 A language is regular if and only if 01
a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine [LJIET]
Answer: a)
17 Which of the following is not a regular expression? [LJIET] 01
a) [(a+b)*-(aa+bb)]*
b) [(0+1)-(0b+a1)*(a+b)]*
c) (01+11+10)*
d) (1+2+0)*(1+2)*
Answer: b)
18 Give an example of DFA: [LJIET] 01

Theory Of Computation (3160704) 2022-2023 Page 8


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Answer: The string in {0,1}* that ends with 01.

19 The language described by the regular expression (0+1)*0(0+1)*0(0+1)* over the 01


alphabet {0 1} is the set of

(A) All strings containing at least two 1’s


(B) All strings containing at least two 0’s
(C) All strings that begin and end with either 0’s or 1’s
(D) All strings containing the substring 00 [LJIET]
Answer: B
20 Regular expressions are closed under 01
a) Union
b) Intersection
c) Kleen star
d) All of the mentioned [LJIET]
Answer: d
21 W is any string whose length is n in {0, 1}* and L is the set of all sub-strings of W. The 01
minimum number of states in a non-deterministic finite automaton that accepts L is
_____________.[LJIET]
Answer: n+1
22 The DFA shown below accepts the set of all strings over {0, 1} that 01

(A) End with 00


(B) End with 0
(C) Begin either with 0 or 1
(D) Contain the substring 00 [LJIET]
Answer: A
23 01

Which one of the following is true for this automaton? [LJIET]


(A) b*ab*ab*ab*
(B) b*a(a+b)*
(C) b*ab*ab*
(D) (a+b)*
Answer: B
24 Define: Transition Diagram [LJIET] 01
Answer: Transition diagram is a directed graph in which the vertices of the graph
correspond to the states of FA. If there is a transition from state q to state p on input a,
then there is an arc labeled ‘ a ‘ from q to p in the transition diagram.
25 What are the applications of automata theory? [LJIET] 01
Answer: In compiler construction.
In switching theory and design of digital circuits.

Theory Of Computation (3160704) 2022-2023 Page 9


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

To verify the correctness of a program.


Design and analysis of complex software and hardware systems.
To design finite state machines such as Moore and mealy machines.
26 What is a Regular language ? [LJIET] 01
Answer: The language accepted by M is L(M) is the set {x | δ(q0,x) is in F}. A language
is regular if it is accepted by some finite automaton.
27 Differentiate L* and L+ [LJIET] 01
Answer: L* denotes Kleene closure and is given by L* =U Li
i=0
example : 0* ={Є ,0,00,000,…………………………………}
Language includes empty words also.
L+ denotes Positive closure and is given by L+= U Li
i=1 example:0+={0,00,000,……………………………………..}
28 Construct a r.e for the language which accepts all strings with atleast two c’s over the set 01
Σ={c,b} [LJIET]
Answer: (b+c)* c (b+c)* c (b+c)*
29 What is the closure property of regular sets? [LJIET] 01
Answer: The regular sets are closed under union, concatenation and Kleene closure.
r1Ur2= r1 +r2 r1.r2= r1r2 ( r )*=r*.
30 Give a regular expression for the following regular language: [LJIET] 01
The set of all strings containing 00.
Answer: (0 + 1)* 00 (0 + 1)*
31 For which of the following applications regular expressions can be used ? [LJIET] 01
A. Designing compilers
B. Developing text editors
C. Simulating sequential circuits
D. All of these
Answer: D
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Check the validity of the following equality with proper reason. [Nov-2011-OLD] 2
[LJIET]
(00*1)*1=1+0(0+10)*11
2 Define Dead-End State with Example.[Nov-2011-OLD] [LJIET] 2
3 Give definition of Regular Grammars.[Nov-2011-OLD] [LJIET] 2
4 Write Regular Expressions for the following languages of all strings in {0,1}* 3
(i) Strings that do not end with 01.
(ii) Strings with odd numbers of 1’s (Ones) .[May-2011-OLD] [LJIET]
5 Explain Regular Grammar.[May-2011-OLD] [LJIET] 3
6 Draw FA for regular expression: (111+100)*0.[June-2013-OLD] [LJIET] 3.5
7 Draw an DFA that recognize the language of all strings of 0’s and 1’s of length at least 1 5
that, if they were interpreted as binary representation of integers, would represent evenly
divisible by 3. Your DFA should accept the string 0 but no other strings with leading
0’s.[Nov-2011-OLD] [LJIET]
8 Enlist applications where the finite automaton is useful. Also Find a string of minimum 4
length in {0,1}* not in the language corresponding to the regular expression :
1*(0+10)*1*.[Nov-2011-OLD] [LJIET]
9 Compare FA, NFA and NFA- Λ with illustration OR Compare FA, NFA and NFA- 3,5
^.[May-2011-OLD][Nov-2018-OLD] [LJIET]
10 Suppose that Languages L1 and L2 are the subsets given below. [ Nov-2011- 5
Theory Of Computation (3160704) 2022-2023 Page 10
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

OLD][May-2015-OLD] [LJIET]
Where Σ = { 0 , 1 }
L1 = { x | 00 is not a substring of x }
L2 = { x | x ends with 01 }
Draw FAs recognizing the following languages
(1) L1 - L2 (2) L1∩L2
11 Write definition of Finite Automata and draw FA for the strings: 7
(i) The string with next to last symbol as 0.
(ii) The string with number of 0s odd and number of 1s odd.[May-2011-OLD] [LJIET]
12 Find unrestricted grammar to generate the following language, 7
{ an x bn | ≥ 0, x є {a, b}*, |x| = n }.[Nov-2011-OLD] [LJIET]
13 Suppose that L1 and L2 are the subsets: 7

Draw the Fas recognizing the following languages.[May-2012-OLD][LJIET]


• L1 ∩ L2
• L1 – L2
14 Attempt the following : 7
• Draw FA for (11+110)* 0
• Write a Regular Expression for the String of 0’s and 1’s in which string ends with 1 and
does not contain substring 00.[May-2012-OLD] [LJIET]
15 Write Regular Expressions for the following languages of all strings in {0,1}* 4
(i) Strings that contains odd number of 0’s (zeroes).
(ii) Strings that begin or end with 00 or 11.[ Jan-2013-OLD] [LJIET]
16 Write definition of finite automata and draw FA for the strings:[Jan-2013-OLD] 7
[LJIET]
(i)The string in {0,1}* ending in 10 or 11.
(ii)The string corresponding to Regular expression {11}*{00}*
17 Draw Finite Automata (FA) for following languages: 8
L1 = {x / 11 is not a substring of x, x Є {0,1}*}
L2 = {x / x ends with 10, x Є {0,1}* }
Find FA accepting languages (i) L1 ∩ L2 (ii) L1 – L2 and (iii) L2 – L1 [Jan-2013-OLD]
[Dec-2013-OLD] [Nov-2021-OLD] [LJIET]
18 Define regular language and regular expressions.[June-2013-OLD] [LJIET] 7
• Find regular expression for the following:
• Language of all string that do not end with 01.
• Describe the language corresponding to following: (1+01)*(0+01)*
19 Let M1 and M2 be the FA in fig below for the language L1 and L2, find L1 U L2 and L1 3.5, 7
∩ L2 and L2 – L1.[June-2013-OLD][May-2014-OLD] [LJIET]

Theory Of Computation (3160704) 2022-2023 Page 11


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

20 Write Regular Expressions for the following languages of all strings in {0,1}* 4
(i) Strings that start with 1 and do not end with 10.
(ii) Strings with length 6 or less.[Dec-2013-OLD] [LJIET]
21 Attempt the following : [May-2014-OLD][LJIET] 7
1)Draw FA for (a + b)* baaa.
2)Write a Regular Expression for the String of 0’s and 1’s in which number of 0’s and
1’s are even.
22 Find a regular expression corresponding to each of the following subsets of {0, 1}*. 7
[Dec-2014-OLD] [LJIET]
i. The language of all strings that do not contain the substring 110.
ii. The language of all strings containing both 101 and 010 as substrings.
iii. The language of all strings in which both the number of 0's and the number of l's are
odd.
23 For each of the following regular expressions, draw an FA recognizing the corresponding 7
language.[Dec-2014-OLD] [LJIET]
i. 1(01 + 10)* + 0(11 + 10)*
ii. (010 + 00)*(10)*
24 Let M1, M2 and M3 be the FAs pictured in Figure below, recognizing languages L1, L2, 7
and L3 respectively. [Dec-2014-OLD][LJIET]

Draw FAs recognizing the following languages:


i. L1 U L2
ii. L1 ∩ L2
iii. L1 - L2
iv. L1 ∩ L3
v. L3 - L2
25 Write definition of finite automata and draw FA for the strings: 7
(i) The string in {0,1}* ending in 10 or 11
(ii) The string corresponding to Regular expression {11}*{00}* [May-2015-OLD]
[LJIET]
26 Write Regular Expressions for following 7
(i) The language of all strings in {0,1}* that do not end with 11.
Theory Of Computation (3160704) 2022-2023 Page 12
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

(ii) The language of all strings containing both 101 and 010 as substrings.
(iii) Strings with length 6 or less in {a,b}. [Dec-2015-OLD] [LJIET]
27 Write Regular Expressions corresponding to each of the following subsets of {0,1}* 7
(i) The language of all strings in {0,1}* that containing at least two 0’s.
(ii) The language of all strings containing both 101 and 010 as substrings.
(iii) The language of all strings that do not end with 01. [May-2016-OLD] [May-
2019-OLD] [LJIET]
28 Draw Finite Automata to accept following. 7
(i) Strings that ends in 11 or 10.
(ii) Strings of the language in {0,1}* with odd no. of zeroes and odd no. of ones.
[Dec-2015-OLD] [LJIET]
29 Draw FA for accepting: [May-2016-OLD] [Dec-2013-OLD] [Jun-22-OLD] [LJIET] 7,6
(i)The string in {0,1}* ending in 1 and not containing substring 00.
(ii)The strings with odd no of 1’s and odd no of 0’s.
30 Design a FA for the regular expression (0 + 1)(01)*(011)*.[Oct-2016-OLD] [LJIET] 7
31 Write a regular expression for language L over {0,1} such that every string in L 7
i) Begins with 00 and ends with 11.
ii) Contains alternate 0 and 1.[Oct-2016-OLD] [LJIET]
32 There are 2 languages over Σ = {a , b} 7
L1 = all strings with a double “a”
L2 = all strings with an even number of “a”
Find a regular expression and an FA that define L1∩ L2. [Oct-2016-OLD] [LJIET]
33 Prove the formula (00*1)*1 = 1+0(0+10)*11. [May-2016-OLD] [LJIET] 7
34 Convert the Mealy machine shown in given figure into Moore machine. [May-2016- 7
OLD] [Aug-2021-OLD] [LJIET]

35 Define language. [May-2016-OLD] [LJIET] 7


Draw Deterministic Finite Automata for the following languages
i) L1 = { x ε (0,1)* | x contains 110111}
ii) L2 = { x ε (0,1)* | x contains odd number of zero and even number of 1}
iii) L3 = { x ε (0,1)* | x do not contains 110 }
36 Define NFA and NFA-Λ. Convert the following NFA to DFA [May-2016-OLD] 7
[Jan-2021-OLD] [LJIET]

37 Write regular expression for the following languages 7


i) L1 = {x ε (0,1)* | x do not ends with 11}
Theory Of Computation (3160704) 2022-2023 Page 13
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

ii) L2 = {x ε (0,1)* | x contains both 101 and 110} [May-2016-OLD] [LJIET]


38 Draw FA for each of the following RE. [Oct-2016-OLD] [LJIET] 7
i. (0+1)*(1+00)(0+1)*
ii. (0+1)*(01+110)
iii. (111+100)*0
39 Find regular expression for following [Oct-2016-OLD] [LJIET] 7
i. Language of all strings containing exactly two 0’s.
ii. Language of all strings that begins or ends with 00 or 11.
iii. Language of all strings in which every 0 is followed immediately by 11.
40 Draw Finite Automata (FA) for following languages: 8,7
L1 = {x / 00 is not a substring of x }
L2 = {x / x ends with 01 }
Find FA accepting the language (i) L1 – L2 and (ii) L1 ∩ L2
OR
Suppose that language L1 and L2 are the subsets given below.
L1 = {x | 00 is not a substring of x}
L2 = { x | x ends with 01}
Draw FA for intersection L1 and L. [Dec-2015-OLD][Oct-2016-OLD] [LJIET]
41 Draw Finite Automata (FA) for following languages: 9
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.[May-2011-OLD] [Nov-
2011] [LJIET]
42 Write Regular Expressions for the following languages of all strings in 7
{0,1}*
(i) Strings that do not end with 01.
(ii) The language of all strings containing both 101 and 010 as substrings [May-2017-
OLD] [LJIET]

43 Let M1 and M2 be the two FAs as given below. 7

Draw FA recognizing (L1 υL2) and (L1-L2)where L1 and L2 correspond to M1 and M2


respectively. [May-2017-OLD] [LJIET]

44 Draw a FA for following regular language. 7

(i) (11+110)* 0

Theory Of Computation (3160704) 2022-2023 Page 14


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

(ii) (0+1)*(10+11) [May-2017-OLD] [LJIET]


45 Define language. 7
Draw Deterministic Finite Automata for the following languages i) L1 = { x ε (0,1)* | x
contains101}
ii) L2 = { x ε (0,1)* | x contains odd number of zero and ends with 00}
iii) L3 = { x ε (0,1)* | x ends with 11} [Nov-2017-OLD] [LJIET]
46 Write regular expression for the following languages 7
i) L1 = {x ε (0,1)* | x ends with11}
ii) L2 = {x ε (0,1)* | x contains both 101 and110} [Nov-2017-OLD] [LJIET]
47 Prove that any Regular Language can be accepted by FA. [Nov-2017-OLD] [Jun-2022- 7
OLD] [LJIET]
48 Explain ‘finite state machines with outputs’. Discriminate between Mealy and Moore 3
machines.
[May-2017-OLD] [LJIET]
49 Convert the Moore machine shown in Fig. 2 into an equivalent Mealy machine. 4

[May-2017-OLD] [LJIET]
50 Fig. 3 shows two DFAs M1 and M2, to accept languages L1 and L2, respectively. 7
Determine DFAs to recognize L1 U L2.

[May-
2017-OLD] [LJIET]

51 Write RE for the languages of all Strings that do not end with 01. [Nov-2017-OLD] 3
[LJIET]
52 Draw a FA for following regular language. 4

(i) (11+110)* 0 (ii) (0+1)*(10+11) [Nov-2017-OLD] [LJIET]


53 Design a moore machine to determine residue number 3 for binary number. [Nov-2017- 7
OLD] [LJIET]
54 Write Kleene’s Theorem part-I, Any regular language can be accepted by a finite 7
automation. [Nov-2017-OLD] [Aug-2021-OLD] [LJIET]

Theory Of Computation (3160704) 2022-2023 Page 15


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

OR
Prove Kleene’s theorem part-1[Jun-2022-NEW] [LJIET]
55 Show that for any language L, L*= (L*)* = (L*)+ = (L+)* [June-2013-OLD] [LJIET] 4
56 For following regular expression, Draw an FA recognizing the corresponding language. 3.5
[May-2018-OLD] [LJIET]
(0 + 1)* (1 + 00) (0 + 1)*
57 Write Regular Expression corresponding to each of the following subsets of{0, 3.5
1}*
a. The language of all strings containing both 101 and 010 as substrings.
b. The language of all strings in which both the number of 0’s and the number of
1’s are even. [May-2018-OLD] [LJIET]
58 Let M1 and M2 be the FAs pictured below, recognizing languages L1 and L2 7
respectively

Draw the FAs recognizing the following languages:


L1 ∩ L2
L2 – L1 [May-2018-OLD] [LJIET]
59 What is the regular expression of following FA? [NOV-2018-OLD] [LJIET] 4

60 L1 and L2 are two languages: 7


L1 = {x | 11 is not a substring of x}
L2 = {x | x starts with 0 and ends with 0}
Draw FA for both L1 and L2 and construct FA for L3 = L2 - L1 [NOV-2018-OLD]
[LJIET]
61 An NFA with states 1-5 and input alphabet {a, b} has the following transition table. 7
[NOV-2018-OLD] [LJIET]
Theory Of Computation (3160704) 2022-2023 Page 16
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

q ∂(q,a) ∂(q,b)
1 {1,2} {1}
2 {3} {3} Q.1 Draw its transition diagram
3 {4} {4} Q.2 Calculate ∂* (1,a)
4 {5} Ø Q.3 Calculate ∂* (1,aaabaab)
5 Ø {5}
62 Convert the given Moore machine into Mealy machine. Draw state transition diagram of 4
Mealy machine.

.[May-2018-OLD] [LJIET]
63 Find a regular expression corresponding to each of the following subsets of {0, 1}* 3
1. The language of all strings that begin or end with 00 or 11.
2. The language of all strings containing both 11 and 010 as substrings.[May-2018-
OLD] [LJIET]
64 What are the closure properties of regular languages?[Nov-2018-OLD] [LJIET] 3
65 Explain moore machine and mealy machine[Nov-2018-OLD] [LJIET] 4
66 What are the applications of finite automata? Draw Finite Automata to accept following. 7
(i) the language accepting strings ending with ’01’ over input alphabets Σ =
{0, 1}
(ii) the language accepting strings ending with ‘abba’ over input alphabets Σ
= {a, b}[Nov-2018-OLD] [LJIET]
67 Find a regular expression corresponding to each of the following subsets of 4
{0, 1}*
(i) The language of all strings that begin or end with 00 or 11.
(ii) The language of all strings beginning with 1 and ending with 0. [Nov-2018-OLD]
[LJIET]
68 What are the applications of regular expressions and finite automata? [Nov-2018-OLD] 4
[Aug-2021-OLD] [LJIET]
Design Moore machine to generate 1’s complement of binary number. [May-2019- 3
OLD] [LJIET]
69 Write Regular Expression over the alphabets {a, b} consisting strings: 4
Second last character as ‘a’
Starting with ‘a’ and ending with ‘b’ [May-2019-OLD] [LJIET]
70 Draw FA for following languages: 7
L1 = {w | 00 is not substring of w}
L2 = {w | w ends in 01}[May-2019-OLD] [LJIET]
71 Suppose that L1 and L2 are the subsets 7

Theory Of Computation (3160704) 2022-2023 Page 17


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Draw the FAs recognizing the following Languages:


L1 ∩ L2
L1 ─ L2
[May-2019-OLD] [LJIET]
72 Define Regular Expression. 7
Find Regular Expression corresponding to each of the following subsets of {0,1}*
1) The Language of all strings containing exactly two 0’s
2) The Language of all strings that end with 01
3) The Language of all strings that begin or end with 00 or 11 [Dec-2019-OLD] [LJIET]
73 Draw FAs recognizing following languages, 7
L1 = { x | 00 is not a substring of x }
L2 = { x| x ends with 01 }
Draw FA accepting the language L1 U L2 [Dec-2019-OLD] [LJIET]
74 Explain Distinguishable strings with example. Draw FA corresponding to a Regular 7
Expression (R.E.) = (11+110)*0, where Σ = {0,1} [Dec-2019-OLD] [LJIET]
75 Draw an FA that recognizes the language of all strings containing even no of 0’s and 4
even no of 1’s over Σ = {0,1}. Also write a regular expression for the same
language.[Dec-2019-OLD] [LJIET]
76 Find regular expression and also derive the words corresponding to the language defined 3
recursively below over Σ= {a,b} .
i. a ∈ L
ii. For any x ∈L, xa and xb are elements of L.[Dec-2019-OLD] [LJIET]
77 Define – Moore machine. Convert the following Moore machine into its equivalent 4
Mealy
machine:

Theory Of Computation (3160704) 2022-2023 Page 18


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

.[Dec-2019-OLD] [LJIET]
78 Write regular expressions for the following languages defined over ∑ = {0, 1}: 3
(i) The language of all the strings that do not end with 01.
(ii) The language of all the strings containing even number of 0’s and even
number of 1’s.[Jan-2021-OLD] [LJIET]
79 Define FA and Write recursive definition of NFA. [Nov-2021-NEW][LJIET] 3
80 Find a regular expression of following subsets of {0, 1}* 4
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. [Nov-2021-
NEW][LJIET]
81 Draw Finite Automata to accept following over input alphabets S ={0, 1} 7
(i) The language accepting strings not ending with ’01’ .
(ii)The language accepting strings next to last symbol ‘0’ [Nov-2021-NEW][LJIET]
82 7

[Nov-2021-NEW][LJIET]
83 Give the difference between moore machine and mealy machine. [Nov-2021- 3
NEW][LJIET]
84 Design and mealy machine that gives output 1 if input of sequence abb comes, other wise 0. 4
[Nov-2021-NEW][LJIET]
85 Draw DFA for the following languages defined over ∑ = {a, b}: [Jan-2021- 4
OLD][LJIET]
(i) The language of all the strings with next-to-last symbol is a.
(ii) The language of all the strings containing substring bba
86 Let M1 and M2 be the FAs pictured in Fig. (i) and Fig. (ii) accept the languages 7
L1 and L2, respectively[Jan-2021-OLD][LJIET]
Theory Of Computation (3160704) 2022-2023 Page 19
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Draw FAs accepting the following languages: (i) L1 ∪ L2 (ii) L2`


87 Answer the following[Jan-2021-OLD][LJIET] 7
1. Define regular language and regular expressions.
2. Find regular expression for the following: Language of all string that do not end with
01.
3. Describe the language corresponding to following: (1+01)*(0+01)*
88 Answer the following[Jan-2021-OLD][LJIET] 7
1.Draw FA for regular expression: (111+100)*0
2. Let M1 and M2 be the FA in fig below for the language L1 and L2, find L1 U L2 and
L1 L2.

89 Prove that any Regular Language can be accepted by FA.[Jan-2021-OLD][LJIET] 7


90 Develop an FA corresponding to following regular expression 𝑟 = (11 + 110)∗0Explain 7
the properties of Distinguishability of Strings and Equivalence classes, show minimum
numbers of states necessary for this FA.[Oct-2020-OLD][LJIET]
91 Explain Moore machine and Mealy machine. Give example of two equivalent machines 4
of each type performing similar function.[Oct-2020-OLD][LJIET]
92 Draw FA for accepting: The strings with odd no of 1’s and odd no of 0’s. [Aug-2021- 4
OLD][LJIET]
93 Find regular expression for following 3
I. Language of all strings containing exactly two 0’s.
II. Language of all strings that begins or ends with 00 or 11. [Nov-2021-OLD][LJIET]
94 Draw FA for each of the following RE. 3
(a+b)*baaa [Aug-2021-OLD][LJIET]
95 Explain moore machine and mealy machine. [Nov-2021-OLD][LJIET] 4
96 What are the closure properties of regular languages? [Dec-2022-OLD][LJIET] 3
97 Write down 5-tuple definition for the finite automata. Construct the 7
minimal finite automata over Σ = {a,b} for the following languages.
L1 = {Where all the strings start and ends with different symbol}

Theory Of Computation (3160704) 2022-2023 Page 20


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

.L2 = {Where every string has odd occurrences of “ba”} [Dec-2022-NEW][LJIET]


98 Enlist types of grammars, types of languages and types of automata. [Dec-2022- 3
NEW][LJIET]
99 Find a regular expression of following subsets of {0, 1}*[Jun-2022-OLD][LJIET] 4
1. The language of all strings that contain odd number of 1's
2. The language of all strings with next to last symbol 0.
100 Draw Finite Automata to accept following over input alphabets Σ ={0, 1} [Jun-2022- 7
OLD][LJIET]
1. The language accepting strings not containing '00’ .
2. The language accepting even number of 0's and odd numbers of 1's
101 Define Moore machine and Design it to generate 1’s complement of 4
binary number.[Jun-2022-OLD][LJIET]
102 Explain how to Convert moore machine to mealy machine[Jun-2022-OLD][LJIET] 3
103 Draw Finite automata for following regular expression: [Jun-2022-NEW][LJIET] 7
(i). (0 + 1)∗(1 + 00)(0 + 1)∗
(ii). (111 + 100)∗0
104 Explain Regular language & Regular expressions. [Jun-2022-NEW][LJIET] 3
105 Find a regular expression corresponding to each of the following 4
subsets of {0,1}* [Jun-2022-NEW][LJIET]
(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
TOPIC:2: Non Determinism Finite Automata, Conversion from NFA to
FA, Λ-Non Determinism Finite Automata Conversion of NFA- Λ to
NFA and equivalence of three Kleene’s Theorem, Minimization of
Finite automata Regular And Non Regular Languages – pumping
lemma.
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 Define: NFA [LJIET] 01
Answer: A nondeterministic finite automaton (NFA), or nondeterministic finite state
machine, does not need to obey these restrictions. In particular, every DFA is also an
NFA.
An NFA is represented formally by a 5-tuple, (Q, Σ, Δ, q0, F), consisting
a finite set of states Q
a finite set of input symbols Σ
a transition function Δ : Q × Σ → P(Q)
an initial (or start) state q0 ∈ Q
a set of states F distinguished as accepting (or final) states F ⊆ Q.
2 Differentiate NFA and DFA. [LJIET] 01
Answer: NFA or Non Deterministic Finite Automaton is the one in which there exists
many paths for a specific input from current state to next state. NFA can be used in
theory of computation because they are more flexible and easier to use than DFA.

Deterministic Finite Automaton is a FA in which there is only one path for a specific
input from current state to next state. There is a unique transition on each input
symbol.(Write examples with diagrams).
3 Define: Pumping Lemma Theorem [LJIET] 01
Answer: Let L be a regular language. Then there exists a constant ‘c’ such that for every
string w in L −
Theory Of Computation (3160704) 2022-2023 Page 21
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

|w| ≥ c

We can break w into three strings, w = xyz, such that −

|y| > 0
|xy| ≤ c
For all k ≥ 0, the string xykz is also in L.
4 Give application of Pumping Lemma Theorem [LJIET] 01
Answer: Pumping Lemma is to be applied to show that certain languages are not regular.
It should never be used to show a language is regular.
1) If L is regular, it satisfies Pumping Lemma.
2) If L is non-regular, it does not satisfy Pumping Lemma.
5 True or False:[LJIET] 01
a^n b^m, where the alphabet is a; b and n >=0;m>=0, is a regular language.(True)
6 Which of the following is true? [LJIET] 01
a) Every subset of a regular set is regular
b) Every finite subset of non-regular set is regular
c) The union of two non regular set is not regular
d) Infinite union of finite set is regular
Answer: b
7 Write Kleens Theorem [LJIET] 01
Answer: Any regular language is accepted by a finite automaton.
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Write a Short note on Application of Pumping Lemma.[Dec-2013-OLD] [LJIET] 3
2 Use the pumping lemma to show that following language is not regular: L = {ww|w ϵ 2
{0,1}*} .[June-2013-OLD] [LJIET]
3 Use the pumping lemma to show that following language is not regular. 3
L = {xy | x, y ϵ {0, 1}* and y is either x or xr }.[May-2018] [LJIET]
4 Define Nondeterministic Finite Automata (NFA) and write down recursive definition of 3
δ* for NFA- Λ.[May-2011-OLD] [LJIET]
5 For following NFA find minimum FA accepting same language:[LJIET] [June-2013- 5
OLD]

6 What do you mean by Regular Language? Explain the application of the Pumping 4
Theory Of Computation (3160704) 2022-2023 Page 22
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Lemma to show a Language is Regular or Not.[Jan-2013-OLD] [LJIET]


7 Define Pumping Lemma for Regular Languages. Prove that the language L = {an: n is a 5,7
prime number} is not regular.
OR
Define pumping lemma for regular language. Prove that the language
L = {ai | i is NOT prime} is irregular. [Nov-2011-OLD] [May-2016-OLD] [LJIET]
8 For the following Regular Expression draw an NFA- Λ recognizing the corresponding 6
languages.
(i) (00 + 1)* (10)*
(ii) 001*0*11.[May-2011-OLD] [LJIET]
9 What is Pumping Lemma and Equivalence Relation ? Explain. [Dec-2015-OLD] 6
[LJIET]
10 Prove Kleene’s Theorem Part 1 with illustration. [Dec-2015-OLD][May-2016] [LJIET] 7
11 Define NFA – Λ. Explain how to convert NFA – Λ into NFA and FA with suitable 7
example. [Dec-2015-OLD][May-2016-OLD][Nov-2021-OLD] [LJIET]
12 Define Pumping Lemma for Regular Languages. Use Pumping Lemma to show 7
that following languages are not regular.
L = { 0n 12n / n > 0 }
L = { wwR / w ε {0,1}* } [May-2015-OLD] [LJIET]
13 If L ={ 0i 1i | i ≥ 0} Prove that L is regular. [Oct-2016-OLD] [LJIET] 7
14 Prove that if L1 and L2 are regular languages then L1∩ L2 is also a regular language. 7
[Oct-2016-OLD] [LJIET]
15 Convert NFA-^ to NFA and DFA. Initial State: A , Final State: D [May-2015-OLD] 7
MAY-2018-OLD] [LJIET]

16 Explain Pumping Lemma and its applications. OR State pumping lemma for regular 3,7
languages. [Dec-2014-OLD] [May-2016-OLD] [Oct-2016-OLD] [Nov-2018-OLD]
[Nov-2021-NEW][Aug-2021-OLD] [LJIET]
17 Write kleene’s theorem part -1. [Dec-2014-OLD][Nov-2021-NEW] [LJIET] 7
18 Prove Kleene’s Theorem (Part I): Any Regular Language can be accepted by a Finite 6,7
Automaton (FA). [Jan-2013-OLD] [LJIET] OR
Prove that any Regular Language can be accepted by FA. [May-2016-OLD ,Oct-2016-
OLD] [LJIET]
19 Prove : The language accepted by any finite automaton is regular. [May-2014-OLD] [LJIET] 7
20 Minimize the following DFA (If Possible). [May-2014-OLD [LJIET] 7

Theory Of Computation (3160704) 2022-2023 Page 23


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

21 What is Pumping Lemma and Equivalence Relation ?[May-2014-OLD] [LJIET] 7


22 Convert the following NFA- Λ into FA.[May-2014-OLD] [Jun-2022-OLD] [LJIET] 7

23 Compare FA , NFA and NFA- Λ. 7


For the following Regular Expression draw an NFA- recognizing the corresponding
language.
(0 + 1)* (10+110)* 1.[Dec-2013-OLD] [LJIET]
24 Write theorem: For any NFA M =(Q,Σ,q0,A,δ) accepting a language L, there is an FA 7
M1 =(Q,Σ,q1,A1,δ1) that also accepts L.[June-2013-OLD] [LJIET]
25 Compare FA , NFA and NFA- Λ. For the following Regular Expression draw an NFA-Λ 6
recognizing the corresponding: (0 + 1)* (10+01)* 11.[Jan-2013-OLD] [LJIET]
26 Prove: Any Regular Language can be accepted by a finite automaton ( Kleene’s 7
Theorem, Part – I ) .
OR
Prove Kleene’s Theorem (Part I): Any Regular Language can be accepted by a Finite
Automaton(FA)
[May-2012-OLD ,June-2013-OLD,Dec-2013-OLD] [LJIET]
27 Minimize the following DFA (If Possible). [May-2012-OLD][June-2013-OLD] 7, 5
[LJIET]
OR
Find a minimum – state FA accepting language of the given FA.[June-2022-OLD]
[LJIET]

Theory Of Computation (3160704) 2022-2023 Page 24


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

28 Define Pumping Lemma. Use the Pumping Lemma to show that the following languages 7
are not regular:[May-2012-OLD] [LJIET]
• L = { 0n 1 02n / n ≥ 0 }
• L = { 0i 1j 0k / k > i+j }
29 Define δ* for!FA- NFA and NFA-Λ. Also Calculate δ* (1, ab) and δ* (1, abaab) from 7
the following transition table.[May-2012-OLD] [Jun-2022-OLD] [LJIET]

30 Convert the following NFA into FA. [May-2012-OLD] [LJIET] 7


OR
Convert following NFA into equivalent DFA. Draw DFA and give Transition
Table for it. [Jun-2022-OLD][LJIET]

31 Explain the procedure for converting the given DFA in to minimum number of state 7
DFA. Using this procedure convert the following DFA into minimum number of states
DFA (minimized FA) where Σ = {0,1}.[Nov-2011-OLD] [LJIET]

32 Consider the following NFA-^. 7


Q δ (q,Λ) δ(q, 0) δ(q, 1)
-A {B} { } Ǿ
B {D} {C} Ǿ

Theory Of Computation (3160704) 2022-2023 Page 25


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

C Ǿ Ǿ {B}
+D Ǿ {D} Ǿ
[1] Convert this NFA-^ into its equivalent NFA.
[2] Take this NFA as an input and convert it into equivalent DFA.[Nov-2011-OLD]
[LJIET]
33 Convert the NFA given in Table below to its corresponding DFA and draw the 7
DFA .[Oct-2016-OLD] [LJIET]

34 Minimize the following FSM [May-2016-OLD] [LJIET] 7

35 For each of the RE draw NFA-ᴧ [Oct-2016-OLD] [LJIET] 7


i. (0+1)*(011+01010)(0+1)* ii.(0+1)(01)*(011)*
36 Find minimum state FA recognizing the language corresponding to following 7
RE. i. (0*10+1*0)(01)* ii. (010)*1 + (1*0)* [Oct-2016-OLD] [LJIET]
37 8

[May-2015-OLD] [LJIET]
38 Convert following NFA- Λ to NFA and FA.[Jan-2013-OLD][Dec-2013-OLD] [LJIET] 8
Q δ (q,Λ) δ(q, 0) δ(q, 1)
A {B,D} {A} Ǿ
B Ǿ {C} {E}
C Ǿ Ǿ {B}
D Ǿ {E} {D}
E Ǿ Ǿ Ǿ
39 Convert following NFA- Λ to NFA and FA.[May-2011-OLD] [LJIET] 8
q δ (q,Λ) δ(q, 0) δ(q,
)
A {B} {A} Ǿ
B {D} {C Ǿ
C Ǿ Ǿ {B}
D Ǿ {D} Ǿ

Theory Of Computation (3160704) 2022-2023 Page 26


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

40 Compare FA, NFA and NFA-٨.[May-2017-OLD] [Nov-2021-OLD] [LJIET] 7


41 Write Kleene’s Theorem part-I, Any regular language can be accepted by a finite 7
automation. [May-2017-OLD] [LJIET]
42 Convert following NFA- Λ to NFA 7

[May-2017-OLD] [LJIET]
43 Define NFA and NFA-Λ. Convert the following NFA to DFA 7

[Nov-2017-OLD] [LJIET]

44 Prove that the following language is ambiguous and convert into unambiguous 7
E → E + E | E * E | id [Nov-2017-OLD] [LJIET]
45 Minimize the following FA. 7

[Nov-2017-OLD]
[LJIET]
46 State pumping lemma for FA. Prove that L = { 0n1n} is not regular [Nov-2017-OLD] 7
[LJIET]
47 Define DFA and NFA and NFA- Λ. [May-2017-OLD][Aug-2021-OLD] [LJIET] 3

Theory Of Computation (3160704) 2022-2023 Page 27


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

48 Give recursive definitions of the extended transition functions, δ̂ ̂(i.e., for strings) for 4
DFA and NFA. [May-2017-OLD] [LJIET]

49 Minimize the DFA shown in Fig. 1. 7

[May-2017-
OLD] [LJIET]

50 Consider the NFA-Λ depicted in following table: 7

(i) Compute the Λ-closure of each state.

(ii) Convert the NFA-Λ to a DFA. [May-2017-OLD] [LJIET]


51 Use Pumping Lemma to show that L = {x Є {0,1}* | x is a palindrome} is not a regular 7
language. [May-2017-OLD] [LJIET]
52 Give recursive definition of regular expressions. State the hierarchy of the operators used 3
in regular expressions. [May-2017-OLD] [LJIET]
53 Using constructive approach determine NFA- Λ for the regular expression: 4
(0 + 1)*1(0 + 1). [May-2017-OLD] [Aug-2021-OLD][LJIET]
54 Give recursive definitions of the extended transition functions, δ* for DFA and NFA. 4,3
[Nov-2017-OLD] [Aug-2021-OLD] [LJIET]
55 Compare FA, NFA and NFA- Λ [Nov-2017-OLD] [LJIET] 3
56 Convert following NFA- Λ to NFA 7

[Nov-2017-OLD ][LJIET]
57 Convert following NFA-Λ to NFA, draw the NFA. {E} ϵ A. [NOV-2018-OLD][LJIET] 7
q ∂(q, Λ) ∂ (q,0) ∂ (q,1)
A {B,D} {A} Ø
B Ø {C} {E}
C Ø Ø {B}
Theory Of Computation (3160704) 2022-2023 Page 28
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

D Ø {E} {D}
E Ø Ø Ø
58 Draw NFA – Λ for ((0 + 1)*10 + (00)*(11)*)* Show step by step construction. [NOV- 7
2018-OLD][LJIET]
59 State part-1 and part-2 of Kleens theorem and show the proof. [NOV-2018- 7
OLD][LJIET]
60 Convert this NFA to FA [NOV-2018-OLD][LJIET] 7

61 Figure shows NFA-^. Draw an FA accepting the same language. [May-2018-OLD 7


][LJIET]

62 Let M1, M2 and M3 be the FAs pictured in Figure, recognizing languages L1, L2 and 7
L3, respectively.

Draw FAs recognizing the following languages.


a. L1 U L2
b. L1 ∩ L3.[May-2018-OLD] [LJIET]
63 Define NFA-Ʌ. Explain how to convert NFA-Ʌ into NFA and FA with 7
suitable example.[Nov-2018-OLD] [LJIET]
64 Write difference between DFA and NDFA. Convert the following NDFA to 7
DFA.

Theory Of Computation (3160704) 2022-2023 Page 29


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

.[Nov-2018-OLD] [LJIET]
65 Minimize the given DFA:[May-2019-OLD][LJIET] 4

66 Convert NFA-^ to NFA and DFA. Initial State: A, Final State : D 7

[May-2019-OLD
][LJIET]
67 Define Pumping Lemma for Regular Languages. Use Pumping Lemma to show that the 7
following languages are not regular.
L = { 0n 12n | n > 0 }
L = { wwR | w ϵ {0,1}* } [May-2019-OLD ][LJIET]
68 Define NFA - Λ. Give Recursive Definition of δ* for DFA,NFA and NFA – Λ. [Dec- 7
2019-OLD ][LJIET]
69 Draw NFA recognizing the language ({0,1}*{10} U {00}*{11}*) * using kleene’s 7
theorem part 1, where Σ = {0,1} [Dec-2019-OLD ][LJIET]
70 Define Pumping Lemma for Regular Languages. Show that following language is not a 7
Regular Language using Pumping Lemma
L = {0i1i | i >=0 }, where Σ = {0,1} [Dec-2019-OLD ][LJIET]
71 Define CFG. Give CFG for L = {0 ͥ 1j 0k | j > i+ k } [Dec-2019-OLD] [LJIET] 7
72 Let FA1 and FA2 be the FAs as shown in the figure recognizing the languages L1 and L2 3
respectively. Draw an FA recognizing the language, L1 U L2.
FA1:

Theory Of Computation (3160704) 2022-2023 Page 30


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

FA2:

[Dec-2019-OLD] [LJIET]
73 Convert the following NFA - Ʌ into its equivalent DFA that accepts the same language: 7

[Dec-2019-OLD] [LJIET]
74 Find a minimum-state FA for the following FA that recognizes the same language using 7
the minimization algorithm:

[Dec-2019-OLD] [LJIET]
75 Prove that the language L= {anbnabn+1 | n=1,2,3,…} is nonregular using pumping lemma. 4
[Dec-2019-OLD] [LJIET]
Theory Of Computation (3160704) 2022-2023 Page 31
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

76 Convert NFA- Λ to FA for following figure. 7

[Nov-2021-NEW][LJIET]
78 Using kleene's Theorem Draw NFA-Λ for ((0+1)*10 + (00)*)* [Nov-2021-NEW][LJIET] 4
79 Convert the following NFA into its equivalent DFA using the subset construction. [Jan-2021- 7
OLD][LJIET]

80 For following NFA find minimum FA accepting same language[Jan-2021-OLD][LJIET] 7

81 State the pumping lemma for regular language. Prove that {0n1n | n >= 0} is not a regular 7
language. [Jan-2021-OLD][LJIET]
82 Convert the Given NFA into its equivalent DFA-[Jan-2021-OLD][LJIET] 7

83 L1 is a language over {0, 1}* that accepts strings ending in 11. L2 is a language over {0, 1}* that 7
accepts strings containing 101 as sub-string. Write the regular expressions, draw FA for L1 and
L2 and derive FA for L1 U L2. [Oct-2020-OLD][LJIET]
84 Apply the subset construction technique to convert the given NFA to FA. [Oct-2020- 7
OLD][LJIET]
Theory Of Computation (3160704) 2022-2023 Page 32
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

85 Draw NFA-Λ for ((0+1)*10 + (00)*(11)*)* [Oct-2020-OLD][LJIET] 4


86 Write Regular Expressions corresponding to each of the following subsets of {0,1}* 4
(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. [Aug-2021-OLD][LJIET]
87 Convert following NFA- Λ to NFA [Aug-2021-OLD][LJIET] 7

88 Minimize the DFA shown in Fig: [Aug-2021-OLD][LJIET] 7

89 Define pumping lemma and its application. [Aug-2021-OLD][LJIET] 4


Define regular language, regular expression and finite automata that recognize 7
the regular language. [Dec-2022-OLD][LJIET]
90 Define ꓥ - Closure of set of states. Find ꓥ-Closure for each of the states in 7
following NFA-ꓥ.[Dec-2022-OLD][LJIET]

Theory Of Computation (3160704) 2022-2023 Page 33


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

91 Convert the NFA-ꓥ in the above question to FA. [Dec-2022-OLD][LJIET] 7


92 Give the Recursive definition of δ* for an NFA and find δ*(q0, 1111), δ*(q0, 7
0011), δ*(q0,1001) and δ*(q0,0111) for the following NFA. q3 ϵ A. [Dec-2022-
OLD][LJIET]

93 Convert the NFA in the above question to FA. [Dec-2022-OLD][LJIET] 7


94 Write and explain the pumping lemma for CFL. [Dec-2022-OLD][LJIET] 7
95 Write Regular Expressions for following. [Dec-2022-OLD][LJIET] 4
(i) The language of all strings in {0,1}* that do not end with 11.
(ii) The language of all strings containing both 101 and 010 as substrings.
96 Consider the NFA-Λ depicted in following table. [Dec-2022-OLD][LJIET] 7

(i) Compute the Λ-closure of each state.


(ii) Convert the NFA-Λ to a DFA
97 Draw FA for follow. [Dec-2022-OLD][LJIET] 7
L1 = {w | 00 is not substring of w}
L2 = {w | w ends in 01}ing languages:
Find FA accepting languages (i)L1 U L2 and (ii)L1 ∩ L2

98 Define pumping lemma for regular language. [Dec-2022-NEW][LJIET] 4


Show that the language L= {anbncn / n>=1} is non-regular using pumping
lemma theory.
99 Construct the Moore machine that counts the no. of occurrences of 7
substring “bba” over Σ = {a,b}.
Now convert this Moore machine into Mealy machine. Show the transition
table and transition diagram for both the machines. [Dec-2022-NEW][LJIET]
100 Define the steps to convert ε -NFA into NFA. Then convert the following 7
ε -NFA into NFA. [Dec-2022-NEW][LJIET]
Theory Of Computation (3160704) 2022-2023 Page 34
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

101 Construct the regular expressions for the following languages. 4


L1 = {Where the no. of ‘a’ is odd}, Σ = {a,b}
L2 = {Where every string starts with ‘0’ and of even length}, Σ = {0,1}[Dec-2022-
NEW][LJIET]
102 Construct the regular expressions for the following languages. 4
L1 = {Where every string starts with ‘b’ and does not contain 2
consecutive a’s}, Σ = {a,b}
L2 = {Where every string starts with ‘1’ and of odd length}, Σ = {0,1}[Dec-2022-
NEW][LJIET]
103 Define pumping lemma for context free language. 4
Show that the language L= {ww / w ∈{a,b}*} is not context free language
using pumping lemma theory. [Dec-2022-NEW][LJIET]
104 Prove “The pumping lemma for regular languages” and use it to prove that the 7,4
Palindromes language is not regular[Jun-2022-OLD][LJIET]
OR
Using pumping lemma prove that the language palindrome is not regular[Jun-2022-
OLD][LJIET]
105 Define FA , NFA , NFA- Λ[Jun-2022-OLD][LJIET] 3
106 Let M1 and M2 be the FAs pictured in Figure, recognizing languages L1 7
and L2 respectively[Jun-2022-OLD][LJIET]

Draw FAs recognizing the following languages.


a. L1 U L2'
b. L2 - L1
Theory Of Computation (3160704) 2022-2023 Page 35
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

107 Using subset construction method Convert NFA- Λ to NFA for 4


following figure[Jun-2022-OLD][LJIET]

108 Find minimum state FA for following figure. [Jun-2022-OLD][LJIET] 7

109 Using kleene's Theorem Draw NFA-Λ for ((01)*10 + (00)*)* [Jun-2022-OLD][LJIET] 4
110 Explain procedure to minimize finite automata[Jun-2022-NEW][LJIET] 7
UNIT NO- 3 : Context free grammar (CFG)
TOPIC:1: Definition, Unions Concatenations And Kleen’s of
Context free language Regular grammar, Derivations and
Languages, Relationship between derivation and derivation trees
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 Define: CFG [LJIET] 01
Answer: A context free grammar (CFG) is denoted as G=(V,T,P,S) where V and T are
finite set of variables and terminals respectively. V and T are disjoint. P is a finite set of
productions each is of the form A->α where A is a variable and α is a string of symbols
from (V U T)*.
2 True or False: It is known that context-free languages are not closed under intersection. 01 for each
Since every regular language is context-free, it follows that the intersection of a regular
language with a context-free one is also not context-free.(False) [LJIET]
Let ∑ = (; ) be an alphabet. The following grammar represents the empty language.
S → (S). [LJIET]
Answer: True
3 The language which is generated by the grammar S-> aSa I bSb I a I b over the alphabet 01
Theory Of Computation (3160704) 2022-2023 Page 36
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

{a, b} is the set of


(A) Strings that begin and end with the same symbol
(B) All odd and even length palindromes
(C) All odd length palindromes
(D) All even length palindromes [LJIET]
Answer: C
4 A CFG G is given with the following productions where S is the start symbol, A is a 01
non-terminal and a and b are terminals.[LJIET]
S→aS∣A
A→aAb∣bAa∣ϵ Which of the following strings is generated by the grammar above?
(A) aabbaba
(B) aabaaba
(C) abababb
(D) aabbaab
Answer: D
5 Give True or false: [LJIET] 01 for each
(a) The context free languages are closed under union.(True)
(b) The context free languages are closed under intersection.(False)
I The context free languages are closed under Kleene star.(True)
(d) The context free languages are closed under complementation.(False)
(e) The context free languages are closed under concatenation.(True)
6 Define: Parsing. [LJIET] 01
Answer: Breaking a data block into smaller chunks by following a set of rules, so that it
can be more easily interpreted, managed, or transmitted by a computer.
7 Give types of Parsing. [LJIET] 01
Answer: 1)Top down Parsing
2) Bottom Up Parsing
8 Differentiate Top down Parsing and Bottom Up Parsing [LJIET] 01
Answer: When the parser starts constructing the parse tree from the start symbol and
then tries to transform the start symbol to the input, it is called top-down parsing.
As the name suggests, bottom-up parsing starts with the input symbols and tries to
construct the parse tree up to the start symbol.
9 What are the uses of Context free grammars? [LJIET] 01
Answer: Construction of compilers.
Simplified the definition of programming languages.
Describes the arithmetic expressions with arbitrary nesting of balanced parenthesis { (, )
}.
Describes block structure in programming languages. Model neural nets.
10 What is Subtree? [LJIET] 01
Answer: A Subtree of a derivation tree is a particular vertex of the tree together with all
its descendants ,the edges connecting them and their labels.The label of the root may not
be the start symbol of the grammar.
11 What are the three ways to simplify a context free grammar? [LJIET] 01
Answer: By removing the useless symbols from the set of productions. By eliminating
the empty productions. By eliminating the unit productions.
12 What is a parser? [LJIET] 01
Answer: A parser for grammar G is a program that takes as input a string w and
produces as output either a parse tree for w ,if w is a sentence of G or an error message
indicating that w is not a sentence of G.
13 What are the closure properties of CFL? [LJIET] 01

Theory Of Computation (3160704) 2022-2023 Page 37


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Answer: CFL are closed under union, concatenation and Kleene closure. CFL are closed
under substitution, homomorphism. CFL are not closed under intersection,
complementation.
14 What are the different types of grammars/languages? [LJIET] 01
Answer: • Unrestricted or Phase structure grammar.(Type 0 grammar)
• Context sensitive grammar or context dependent grammar (Type1)
• Context free grammar (Type 2)
• Regular grammar (Type 3)
15 Define: Regular Grammers [LJIET] 01
Answer: A regular grammar is a formal grammar that is right-regular or left-regular.
Every regular grammar describes a regular language.
16 Define: Right Linear Regular Grammer [LJIET] 01
Answer: A right regular grammar (also called right linear grammar) is a formal grammar
(N, Σ, P, S) such that all the production rules in P are of one of the following forms:

B → a – where B is a non-terminal in N and a is a terminal in Σ

B → aC – where B and C are non-terminals in N and a is in Σ

B → ε – where B is in N and ε denotes the empty string, i.e. the string of length 0.
17 Define: Left Linear Regular Grammer [LJIET] 01
Answer: In a left regular grammar (also called left linear grammar), all rules obey the
forms:

A → a – where A is a non-terminal in N and a is a terminal in Σ

A → Ba – where A and B are in N and a is in Σ

A → ε – where A is in N and ε is the empty string.


Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Write short note on Top Down Parsing And Bottom Up Parsing.[Jan-2013-OLD] 3
[LJIET]
2 Give the difference between Top Down Parsing And Bottom Up Parsing. [May-2011- 4
OLD] [LJIET]
3 Prove: There are context-free languages L1 and L2 so that L1 ∩ L2 is not a CFL and 7
there is a CFL L so that L’ is not a CFL.[May-2012-OLD] [LJIET]
4 Explain Derivation Tree, Expression Tree and Ambiguity with Example.[May-2012- 7
OLD] [LJIET]
5 Write theorem: If L1 and L2 are context free languages, then the language L1 U L2, 7
L1L2 and L1* are also CFLs.[June-2013-OLD] [LJIET]
6 Use the pumping lemma to show that following language is not regular: L = {xy|x,y ϵ 2
{0,1}* and y is either x or xr}.[June-2013-OLD] [LJIET]
7 Explain bottom up parsing with example.[June-2013-OLD] [LJIET] 7
8 Differentiate Regular Grammars and Context Sensitive Grammars.[May-2014-OLD] 7
[LJIET]
9 Top down and bottom up parsing.[Dec-2014-OLD] [LJIET] 7
10 Consider following grammar: 7
S →A1B
A → 0A | Λ
Theory Of Computation (3160704) 2022-2023 Page 38
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

B → 0B | 1B | Λ
Give leftmost and rightmost derivations of the string 00101. Also draw the parse tree
corresponding to this string. [May-2017-OLD] [LJIET]
11 Prove that the language L = {ww| w is in (0 + 1)*} is not a CFL. [May-2018- 3
OLD][LJIET]
12 Write a short note on parsing. .[NOV-2018-OLD] [LJIET] 7
13 Explain Union Rule and Concatenation Rule for Context-Free Grammar. OR Explain 4
Union Rule and Concatenation Rule for Context Free Grammar. [May-2018-OLD][
Nov-2018-OLD] [LJIET]
14 Let G be the grammar 4
S → aB | bA
A → a | aS | bAA
B → b | bS | aBB
For string aaabbabbba, find Left most derivation and Right most derivation. [May-2018-
OLD] [LJIET]
15 Decide whether the given language is a CFL, and prove your answer. 3
L = { xyx | x, y ϵ {a, b}* and |x| ≥ 1}[May-2018-OLD] [LJIET]
16 Consider the grammar: 3
S -> aAS | a
A -> SbA | SS | ba
Derive left most and right most derivation of string aabbaa using given grammar.[May-
2019-OLD][LJIET]
17 Write CFG for the following languages : 4
i. {aibjck | i=j+k}
ii. {aibjck | j=i or j=k}.[Dec-2019-OLD][LJIET]
18 Prove that the context-free languages are closed under union.[Jan-2021-OLD][LJIET] 3
19 Give the context free grammar for the following languages.[Jan-2021-OLD][LJIET] 7
1. L = { anbn|n>=0 }
2. Language for Palindroms.
3. Language for Non-Palindroms.
4. Language for Algebraic Expressions
5. L = { x belongs to {0,1}* | no(x) = n1(x) }
6. L = { x belongs to {0,1}* | no(x) ≠ n1(x) }
7. The set of odd-length strings in {a,b}* with middle symbol a.
20 Prove The Theorem: “If L1 and L2 are context – free languages, then the languages 𝐿1 7
∪ 𝐿2, 𝐿1𝐿2 , 𝐿1* are also CFL.”.[Jun-2022-OLD][LJIET]
21 Define Context free grammar & context free language.”.[Jun-2022-NEW][LJIET] 7
TOPIC:2: Ambiguity Unambiguous CFG and Algebraic Expressions
BacosNaur Form (BNF), Normal Form – CNF
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 Define: CNF [LJIET] 01
Answer: In formal language theory, a context-free grammar G is said to be in
Chomsky normal form (first described by Noam Chomsky) if all of its production
rules are of the form: A → BC, or. A → a
2 What is a ambiguous grammar? [LJIET] 01
Answer: A grammar is said to be ambiguous if it has more than one derivation trees
for a sentence or in other words if it has more than one leftmost derivation or more than
one rightmost derivation.
3 Define: BNF [LJIET] 01
Theory Of Computation (3160704) 2022-2023 Page 39
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Answer: Backus–Naur form or Backus normal form (BNF) is a notation technique for
context-free grammars, often used to describe the syntax of languages used in
computing, such as computer programming languages, document formats, instruction
sets and communication protocols.
Sr. DESCRIPTIVE QUESTIONS Marks
No
1. Give definition of Context-Free Grammars.[Nov-2011-OLD][LJIET] 2
2. Explain in brief Chomsky Normal Form(CNF) . [May-2011-OLD][LJIET] 3
3. Define Context Free Grammar (CFG). Describe the language accepted by following 4
CFG:
S→ aSa | bSb | a | b | Λ.[Jan-2013-OLD [LJIET]
4. Design a CFG for the following language.[May-2011-OLD] [Jan-2013-OLD] [Dec- 4
2013-OLD][LJIET]
L = { 0i 1j 0k / j > i + k }
5. Find CFG for the following languages.[Nov-2011-OLD] [LJIET] 5
1. L = { ai bj ak | j > i + k }
2. L = { ai bj ak | i = j or j = k }
6. Given the Context Free Grammar G, find a CFG G’ in Chomsky Normal 5
Form generating L(G) – { }
S → SS | A | B
A → SS | AS | a
B → /\ [May-2015-OLD] [LJIET]
7. Given the context-free grammar G, find a CFG G’ in Chomsky Normal Form 5
generating L(G) – {^}.G has production S → S(S) | ^.[Nov-2011-OLD] [LJIET]
8. For the following CFG’s, describe the language it accepts.[Nov-2011-OLD][LJIET] 5
(1) S → SS | XaXaX | ^
X → bX | ^
2. S → aM | bS
M → aF | bS
F → aF | bF | ^
3. S → aS | bS | a | b | ^
9. Define CFG. Prove that the following CFG is Ambiguous. 6
S → S + S | S * S | (S) | a
Write the unambiguous CFG for the above grammar.[May-2011-OLD] [LJIET]
10. Give the context free grammar for the following languages. 7,3
(011 +1)* (01)*
OR
Find the CFG for the regular expression : (011+1)∗ (01)∗
[May-2016-OLD][NOV-2018-OLD][Dec-2019-OLD][LJIET]
11. Given the Context Free Grammar G, find a CFG G’ in Chomsky Normal Form 7
generating L(G) – { }
(1) S → aY | Ybb | Y

X → /\ | a
Y → aXY | bb | Xxa
2) S → AA
A → B | BB
B → abB | b | bb [May-2015-OLD] [LJIET]
12. Define Context Free Grammar(CFG). 7
Theory Of Computation (3160704) 2022-2023 Page 40
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

Find CFG for following language:


L = { 0i 1j 0k / j > i + k }[Dec-2015-OLD] [LJIET]
13. Prove that following CFG is Ambiguous and convert it into unambiguous. 7
S ->S + S | S * S | (S) | a [Dec-2015-OLD] [LJIET]
14. Design an ambiguous grammar for if-then-else statement that also generates if-then
statement. Re-write an equivalent unambiguous grammar. Prove that Grammar is 7
Unambiguous by tracing “ic1tic2taea”. [May-2015-OLD] [LJIET]
15. Define Context Free Grammar(CFG). Design CFG for Generating Following Language: 7
(1) For Balanced Parenthesis
(2) Set of even length strings in {a, b, c, d}* with two middle symbol equal. [May-
2015-OLD] [LJIET]
16. Generate the Context-Free Grammars that give the following languages.[Dec-2014- 7
OLD][LJIET]
(i) {w | w contains at least three 1s}
(ii) {w | w starts and ends with the same symbol}
17. Define CFG and Design a CFG for the following language.[May-2014-OLD] [LJIET] 7
L = { x ∈ {0,1}* | n0(x) ≠ n1(x) }
18. Let L be the language corresponding to the regular expression (011+1)* (01)*. Find the 7
CFG generating L. [May-2014-OLD] [LJIET]
19. Given the CFG G, find a CFG G’ in Chomsky Normal form generating L(G) – { Λ}. 7
[May-2014-OLD] [May-2019-OLD] [LJIET]
S→A | B | C
A→ aAa | B
B→ bB | bb
C→ aCaa | D
D→ baD | abD | aa
20. Find context free grammar generating following language {ai bj ck | I = j or I = k} 7
• Show that CFG S→ a|Sa|bSS|SSb|SbS is ambiguous.
• find an equivalent unambiguous grammar for following:
S→ A|B A→aAb|ab B→abB|ε.[June-2013-OLD] [LJIET]
21. Prove that the following CFG is Ambiguous.[Jan-2013-OLD] [Dec-2013-OLD][LJIET] 7,6
S → S + S | S * S | (S) | a
Write the unambiguous CFG for the above grammar. Draw Parse tree for the string a + a * a.
22. Prove that the following CFG is Ambiguous. 7
S -> S + S | S * S | a | b
Write the unambiguous CFG based on precedence rules for the above grammar. Derive
the parse tree for expression (a + a)*b from the unambiguous grammar.[Oct-2016-OLD]
[LJIET]
23. Convert following CFG to equivalent Chomsky Normal Form(CNF) 7
S →AACD | ACD | AAC | CD | AC | C
A →aAb | ab
C →aC | a
D →aDa | bDb | aa | bb.[Jan-2013-OLD ,Dec-2013-OLD] [LJIET]
24. Define CFG and Design a CFG for the following language.[May-2012-OLD][LJIET] 7
L = { 0i 1j 0k / j > I + k }
25. Given the CFG G, find a CFG G’ in Chomsky Normal form generating L(G) – { Λ} 7
S→ AaA | CA | BaB
A→ aaBa | CDA | aa | DC
B→ bB | bAB | bb | aS
C→ Ca | bC | D
Theory Of Computation (3160704) 2022-2023 Page 41
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

D→ bD | Λ.[May-2012-OLD ,Dec-2014-OLD] [LJIET]


26. Check whether the given grammar is in CNF 7
S-> bA|aB
A-> bAA|aS|a
B-> aBB|bS|b
If it is not in CNF, Find the equivalent CNF. [May-2016-OLD] [LJIET]
27. Convert the CFG, G ({S,A,B},{a,b},P , S) to CNF , where P is as follows 7
S → aAbB A → Ab | b B → Ba | a .[Oct-2016-OLD] [Aug-2021-OLD] [LJIET]
28. Define Context Sensitive Grammar. Design a CSG for the following language 7
L = {an bn cn | n > 0}.[May-2016-OLD] [LJIET]
29. Prove that the following language is ambiguous and convert into unambiguous 7
S → S + S | S * S | a [May-2016-OLD] [LJIET]
30. Define Context-Sensitive Grammar. What is the language of following context-sensitive 3
grammar?
S → aTb | ab
aT → aaTb | ac.[Nov-2018-OLD] [LJIET]
31. Define Context Free Grammar. Design a CFG for the following language.[May-2016- 7
OLD] [LJIET] L = { x ε (0,1)* | n0(x) = n1(x)}
32. For the following CFG, Find Chomsky normal form 7
S->AACD A->aAb|ᴧ C-> aC|a D->aDa|bDb|ᴧ [Oct-2016-OLD][May-2018-OLD][Aug-
2021-OLD] [LJIET]
33. For the following CFG, Find Chomsky normal form 7
S->AaA|CA|BbB A->aaBa|CDA|aa|DC B->bB|bAB|bb|aS
C->Ca|bC|D D->bD|ᴧ [Oct-2016-OLD] [LJIET]
34. Given the Context Free Grammar G, find a CFG G’ in Chomsky Normal Form 7
generating L(G) – { }
S → aY | Ybb | Y X → /\ | a Y → aXY | bb | Xxa [May-2017-OLD] [LJIET]

35. Define Context Free Grammar. Design a CFG for the following language L = {an bn | n 7
>0}. [Nov-2017-OLD] [LJIET]
36. Convert the following language in Chomsky normal form. 7
S→ASB | SAB A→ BC B→ bB | c C → e [Nov-2017-OLD] [LJIET]
37. Give the recursive definition of the iterated derivation (i.e., derivation in zero or more 4
steps), denoted as =>̽. Give mathematical description of the language of a CFG. [May-
2017] [LJIET]
38. Define CFG. When is a CFG called an ‘ambiguous CFG’? [May-2017-OLD] [Nov- 3
2017-OLD] [Aug-2021-OLD] [LJIET]
39. Consider following grammar: 4
S →ASB | Λ
A → aAS | a
B → SbS | A | bb
i. Eliminate useless symbols, if any.
ii. Eliminate Λ productions. [May-2017-OLD] [Aug-2021-OLD] [LJIET]
40. Given the Context Free Grammar G, find a CFG G’ in Chomsky Normal Form 7
generating L(G) – { }
S → aY | Ybb | Y X → /\ | a Y → aXY | bb | Xxa [Nov-2017-OLD] [LJIET]
41. (1) Write a CFG for solving simple (& parenthesized) expression, such as + and *. 7
(ii) Also write CFG fir regular expression r = (a + b) (a + b + 0 + 1)*
Use CFG defined for part(i).
(iii) Derive the string (which is defined in part(ii)) a * (a + b00) by applying left most
Theory Of Computation (3160704) 2022-2023 Page 42
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

derivation and right most derivation. [May-2018-OLD] [LJIET]


42. Define Context Free Grammar. Design a CFG for the language 7
L = { aibjck | i ≠ j + k } [May-2018-OLD] [LJIET]
43. Show that the CFG with productions 3
S → a | Sa | bSS | SSb | SbS
is ambiguous. [May-2018-OLD] [LJIET]
44. Given the context-free grammar G, find a CFG G’ in Chomsky Normal Form. G : . 7
S → AaA | CA | BaB
A → aaBa | CDA | aa | DC
B →bB | bAB | bb | aS
C→ Ca | bC | D
D → bD | ɛ
ɛ represents null. [May-2018-OLD] [LJIET]
45. Define Context Free Grammar. Find context-free grammar for the language: L = {aibj | i < 7
2j}. [May-2018-OLD] [LJIET]
46. Define Context-Sensitive Grammar. Write a CSG for {anbncn | n ≥ 1}. [May-2018-OLD] 4
[LJIET]
47. What is CNF? Convert the following CFG into CNF. 7
S → ASA | aB,
A → B | S,
B → b | ε. [Nov-2018-OLD] [LJIET]
48. Give the left linear grammar for RE (10)*1. [May-2019-OLD] [LJIET] 3
49. Define CFG. When a CFG is called an ‘ambiguous CFG’? [Nov-2018-OLD] [LJIET] 4
50. Consider the grammar: S->ABA, A->aA | ɛ, B->bB | ɛ 7
Is given grammar ambiguous? If so then remove ambiguity[May-2019-OLD] [LJIET]
51. Find context free grammar for the following language. 7
L1={aibjck | i = j + k}, L2= (011+1)* (01)*, L3=(0+1)1*(1+(01)*) [May-2019-OLD]
[LJIET]
52. Eliminate useless symbols, ɛ -productions and unit productions for the following 7
grammar:
S->0A0 | 1B1 | BB, A->C, B->S | A, C->S | ɛ [May-2019-OLD] [LJIET]
53. Give CFG for following languages: 4
1). L = a*b* 2). L = {an+2 bn | n >= 0} [May-2019-OLD] [LJIET]
54. Construct finite automata for following left linear grammar: 7
S -> X0 | Y1
X -> Y1
Y -> Y0 | 1 [May-2019-OLD] [LJIET]
55. Define Ambiguous grammar. Write Unambiguous grammar for following grammar : 7
E → E + E | E * E | ( E ) | id
Derive string “id+id*id” using unambiguous grammar. [May-2019-OLD] [LJIET]
56. Design Context Free Grammar for following Language : 7
L = { 0i1j0k | j > i + k } [May-2019-OLD] [LJIET]
57. Convert following CFG to Chomsky Normal Form, 7
(1) S→ AACD
(2) A →aAb | Λ
(3) C→ aC | a
(4) D→ aDa | bDb | Λ [Dec-2019-OLD] [LJIET]
58. Prove that following Grammar is an Ambiguous Grammar 7
S→ S +S | S*S | (S) | a
Draw parse tree for string a+a*a using above grammar [Dec-2019-OLD] [LJIET]
59. Prove that – “If there is a CFG for the language L that has no Ʌ-productions, then there 3
Theory Of Computation (3160704) 2022-2023 Page 43
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

is a CFG for L with no Ʌ-productions and no unit productions”. Support your answer
with the help of the following CFG: S →A | bb A →B | b B →S | a[Dec-2019-OLD]
[LJIET]
60. Define – ambiguous grammar, leftmost derivation. Check whether the following 7
grammars are ambiguous or not. Justify your answer with proper reason.
i. S →ABA
A →aA | Ʌ B →bB | Ʌ
ii. S → A | B
A →aAb | aabb B →abB | Ʌ[Dec-2019-OLD] [LJIET]
61. Describe the language generated by the following grammars: 3
i. S →aA | bC | 𝑏
A →𝑎𝑆 | bB B →𝑎𝐶 | bA | 𝑎 C →aB | bS

ii. S → aT | bT | Ʌ
T →aS | bS
[Dec-2019-OLD] [LJIET]
62. Convert the following CFG into its equivalent CNF: 7
S → TU | V
T → aTb | Ʌ U→ cU | Ʌ V →aVc | W W →bW | Ʌ
[Dec-2019-OLD] [LJIET]
63. Define Context Sensitive Language and Context Sensitive Grammar. Write CSG for 3
L={an bn cn| n ≥1}.
[Dec-2019-OLD] [LJIET]
64. Define 1) Parse tree 2) Ambiguous grammar[May-2019-OLD] [LJIET] 3
65. Define Context Free Grammar. Find context-free grammar for the language: 4
L={ai bj ck | j=i+k} [Nov-2021-NEW][LJIET]
66. Define Ambiguous grammar. for following grammar say whether the grammar is 3
ambiguous or not. give reason
S→ABA, A→aA | Λ , B→bB | Λ [Nov-2021-NEW][LJIET]
67. Give an unambiguous grammar for SIMPLE CALCULATOR contain +, -, *, /,(,) operator for 4
terminal ‘id’. And draw a parse tree for (id+id)*id-id [Nov-2021-NEW][LJIET]
68. Find the CFG for the regular expression : (01*1 + 1)* (01)* [Nov-2021-NEW][LJIET] 3
69. Given the context-free grammar G, find a CFG G’ in Chomsky Normal Form. 7
S -> AaA | CA | BaB
A -> aaBa | DC
B -> bb | aS
C -> Ca | bC | D
D -> bD | Λ [Nov-2021-NEW][LJIET]
70. For the following CFG, find out two left most derivations for the string “aaabb” and also draw 4
the corresponding parse trees. [Jan-2021-OLD][LJIET]
S → XY
X → XX | a
Y → YY | b
71. Define CNF. Also convert the following CFG into its equivalent CNF. [Jan-2021-OLD][LJIET] 7
S → aX | Y | bab
X→^|Y
Y → bb | bXb
72. What language over {a, b}* does the CFG with productions[Jan-2021-OLD][LJIET] 3
S → aT | bT
T → aS | bS | ^ generate? Prove your answer.
73. Find context-free grammar generating the languages below. [Jan-2021-OLD][LJIET] 7
(i) {ai bj ck | j=i or j=k}

Theory Of Computation (3160704) 2022-2023 Page 44


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

(ii) {ai bj ck | j ≠ i + k }
74. Define CFG. Prove that the following CFG is Ambiguous. [Jan-2021-OLD][LJIET] 7
S→S + S | S * S | (S) | a
Write the unambiguous CFG for the above grammar.
75. Define a CFG for language having strings with equal number of 0’s and 1’s. 4
𝐿 = { 𝑥 ∈ {0,1}∗| 𝑛0(𝑥) = 𝑛1(𝑥)} [Oct-2020-OLD][LJIET]
76. What is an Ambiguous CFG? Explain with reference to dangling else problem. [Oct-2020- 3
OLD][LJIET]
77. Derive a CFG equivalent to following regular expression 7
(011 + 1)∗(01)∗ [Oct-2020-OLD][LJIET]
78. What are Nullable variable in a CFG? How can we remove them from a production? [Oct-2020- 3
OLD][LJIET]
79. What are the steps to convert a CFG to Chomsky Normal Form? [Oct-2020-OLD][LJIET] 7
80. What language will be generated by this CFG: [Oct-2020-OLD][LJIET] 4
S → aT | bT | Λ
T → aS | bS
81. Consider the grammar: 3
S→aAS | a
A→ SbA | SS | ba
Derive left most and right most derivation of string aabbaa using given grammar. [Aug-
2021-OLD][LJIET]
82. Define CFG. Create CFG for (011+1)*(01)* [Aug-2021-OLD][LJIET] 4
83. Explain Ambiguous Grammar and remove ambiguity with suitable example. [Aug-2021- 4
OLD][LJIET]
84. Suppose that the language L over {a, b}* is define as follows: 7
1. a ϵ L
2. For any x ϵ L, ax ϵ L.
3. For any x and y in L, all the strings bxy, xby, and xyb are in L.
4. No other strings are in L.
Prove that L contains every element of {a,b}* having more a’s than b’s.
[Dec-2022-OLD][LJIET]

85. Convert the following grammar to CNF. [Dec-2022-OLD][LJIET] 7


S → ABDA
A → aAb | Λ
B → cB | c
D → bDb | aDa | Λ
86. Construct a deterministic bottom-up parser for a CFG[Dec-2022-OLD][LJIET] 7
S → A$
A→A+T
A→T
T→T*a
T→a
87. Derive the string “aabbababbaa“ using leftmost derivation for the 7
following grammar. [Dec-2022-OLD][LJIET]

88. Prove that following CFG is Ambiguous. [Dec-2022-OLD][LJIET] 4

Theory Of Computation (3160704) 2022-2023 Page 45


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

S -> S + S | S * S | (S) | a
89. Find CFG for following language: [Dec-2022-OLD][LJIET] 7
L = { 0i 1j 0k / j > i + k }
90. Define type 2 grammar with example. [Dec-2022-NEW][LJIET] 3
91. Define: CNF. Show the steps to convert CFG into CNF. Convert the 7
following CFG into equivalent CNF. [Dec-2022-NEW][LJIET]
92. Explain ambiguous and unambiguous context free grammar with example. [Dec-2022- 7
NEW][LJIET]
93. Enlist closure properties for the context sensitive language. [Dec-2022-NEW][LJIET] 3
94. Answer the following: 3
1.Find a CFG in Chomsky normal form for the following Grammar G.
G has productions { 𝑆 → 𝑆𝑆 | (𝑆)| ∧ }[Jun-2022-OLD][LJIET]
95. Answer the following: [Jun-2022-OLD][LJIET] 4
Give the context free grammar for the following.
1> L = { x {0,1} ∗ | no(x) ≠ n1(x) }
2> L = { x ∈ {0,1} ∗ | no(x) = n1(x) }
96. Check whether the given grammar is in CNF[Jun-2022-OLD] [LJIET] 7
S->bA|aB
A->bAA|aS|a
B->aBB|bS|b
If it is not in CNF, Find the equivalent CNF.
97. Prove The Theorem: “ If L1 and L2 are context – free languages, then the 7
languages 𝐿1 ∪ 𝐿2, 𝐿1𝐿2 , 𝐿1* are also CFL.” [Jun-2022-OLD] [LJIET]
98. Explain ambiguous grammar with example. [Jun-2022-OLD] [LJIET] 3
99. Define Context Free Grammar. Find context-free grammar for the language: 7
a. L = {aibjck | j=i+k}
b. 𝐿 = { 𝑥 ∈ {0,1}∗ | 𝑛0(𝑥) = 𝑛1(𝑥)} [Jun-2022-OLD] [LJIET]
100. Given the context-free grammar G, find a CFG G’ in Chomsky Normal 7
Form. [Jun-2022-OLD] [LJIET]
S→0A0 | 1B1 | BB,
A→0B | C
B→S1 | A
C→01 | Λ
101. Write CFG for following[Jun-2022-NEW] [LJIET] 4
(i) L={aibjck | i=j or j=k}
(ii) L={aibjck | j>i+k}
102. Convert following CFG to CNF : [Jun-2022-NEW] [LJIET] 7
S -> S(S)/^
103. Define Regular grammar and give example. [Jun-2022-NEW] [LJIET] 3
104. Explain types of derivation and ambiguity. [Jun-2022-NEW] [LJIET] 4
105. Convert following CFG to CNF : [Jun-2022-NEW] [LJIET] 7
S->aX/Yb X->S/^ Y->bY/b
UNIT NO- 4 : Pushdown Automata, CFL And NCFL
TOPIC:1: Definition, deterministic PDA, Equivalence of CFG and
PDA, Pumping lemma for CFL, Intersections and Complements of
CFL, Non-CFL
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 The language accepted by a Pushdown Automation in which the stack is limited to 10 01

Theory Of Computation (3160704) 2022-2023 Page 46


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

items is best described as ________________ [LJIET]


(A) Context Free
(B) Regular
(C) Deterministic Context Free
(D) Recursive
Answer: B
2 Define: PDA [LJIET] 01
Answer: A pushdown Automata M is a system (Q, Σ, Ґ ,δ ,q0, Z0,F) where
Q is a finite set of states.
Σ is an alphabet called the input alphabet.
Ґ is an alphabet called stack alphabet. q0 in Q is called initial state.
Zo in Ґ is start symbol in stack. F is the set of final states.
δ is a mapping from Q X (Σ U {Є} ) X Ґ to finite subsets of Q X Ґ *.
3 What is the significance of PDA? [LJIET] 01
Answer: Finite Automata is used to model regular expression and cannot be used to
represent non regular languages. Thus to model a context free language, a Pushdown
Automata is used.
4 What are the components of PDA ? [LJIET] 01
Answer: The PDA usually consists of four components:
A control unit.
A Read Unit.
An input tape.
A Memory unit.
5 Is it true that the language accepted by a PDA by empty stack and final states are 01
different languages. [LJIET]
Answer: No, because the languages accepted by PDA ‘s by final state are exactly the
languages accepted by PDA’s by empty stack.
6 Which of the following is not possible algorithmically ? [LJIET] 01
A. Regular grammar to context free grammar
B. Non-deterministic FSA to deterministic FSA
C. Non-deterministic PDA to deterministic PDA
D. None of these
Answer: C
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Convert following CFG to PDA 2
S → 0S1 | 00 | 11 [May-2015-OLD] [LJIET]
2 [May-2015-OLD] [LJIET] 6
3 Design and draw a deterministic PDA accepting “Balanced strings of Brackets” which are 6,7
accepted by following CFG.
S→ SS | [ S ] | { S } | Λ
OR
Design a pushdown automata to check well-formed parenthesis. [ May-2011-OLD ,May-
2019] [LJIET]
4 For the language L={set of strings over alphabet {a, b} with exactly twice as many a’s as 7
b’s} design a PDA (Push Down Automata) and trace it for the
sring “abaabbaaaaabaab” [May-2015-OLD] [LJIET]
5 For the language L={ ai bj ck | i, j, k ≥ 0 and i + j = k } design a PDA (Push Down 7
Automata) and trace it for String “bbbbbccccc” [May-2015-OLD] [LJIET]
6 Define Push Down Automata (PDA). Design and draw a deterministic PDA accepting 7
Theory Of Computation (3160704) 2022-2023 Page 47
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

strings with more a’s than b’s. Trace it for the string “abbabaa”. [Dec-2015-OLD][May-
2016] [LJIET]
OR
Design and draw a deterministic PDA accepting strings with more a’s than b’s.
Trace it for the string “abbabaa”.[Jun-2022-OLD] [LJIET]
7 Define Push Down Automata (PDA). Draw PDA accepting strings of Brackets like 7
following.
S →SS | {S} | [S] | Λ [Dec-2015-OLD] [LJIET]
8 Design and draw a deterministic PDA accepting strings with more a’s than b’s. Trace it 6,7
for the string “abbabaa” .[Jan-2013-OLD ][May-2014-OLD] [LJIET]
9 Write transition table for PDA recognizing following language: 7
{ ai bj ck | j = i or j = k }.[June-2013-OLD] [LJIET]
10 For the language L = { xcxr / x ε {a,b}* } (Palindrome with middle character=c),Design a 7
PDA(Push Down Automata) and trace it for string “abacaba” .[Dec-2013-OLD] [LJIET]
11 Design and draw a deterministic PDA accepting strings of the language L = { x ∈{ a, b}* | 7
na(x) > nb(x) }. Trace it for the string “aababaab” .[Dec-2013-OLD] [LJIET]
12 Prove: The language pal= { x ∈ {a, b}* | x = xr } cannot be accepted by any deterministic 7
pushdown automaton. [May-2014-OLD] [LJIET]
13 Write PDA for following languages: [Dec-2014-OLD][LJIET] 7
{ x ϵ { a,b,c}* | na(x) < nb(x) or na(x) < nc(x) }.
14 Give transition table for deterministic PDA recognizing the following language 7
{ an bn+m am | n,m ≥ 0) .[Nov-2011-OLD] [LJIET]
15 Give transition table for deterministic PDA recognizing the following language 7
{ ai bj ck | i, j, k ≥ 0 and j = i or j = k }.[Nov-2011-OLD ,Dec-2014-OLD] [LJIET]
16 Define PDA and design PDA for L = { x ∈ { a, b}* | na(x) > nb(x) }.[May-2012-OLD] 7
[LJIET]
OR
Design PDA for the language L = { x ε {a, b}* | na(x) > nb(x) }. }.[May-2019-OLD]
[LJIET]

17 For the language L = { xcxr / x Є {a,b}* } design a PDA(Push Down Automata) and 7
trace it for string “bacab” .
OR
Give transition table for PDA recognizing the following language and trace the move of
the machine for input string abcba: L={xcxr | x ∈{a,b}∗}
[Jan-2013-OLD][Dec-2019-OLD] [LJIET]
18 Write PDA for following languages:[May-2016][LJIET] 7
{ ai bj ck | i, j, k >= 0 and j = i or j = k}.
19 Given a CFG , G =( {S,A,B},{0,1},P,S) with P as follows 7
S --> 0B| 1A A --> 0S|1AA|0 B --> 1S| 0BB | 1
Design a PDA M corresponding to CFG, G. Show that the string 0001101110 belongs to
CFL , L(G).[Oct-2016-OLD] [LJIET]
20 Design a PDA, M to accept L = { an b2n | n ≥ 1 }.[Oct-2016-OLD] [LJIET] 7
21 Define PDA. Draw a PDA for the complement of the following language 7
L = {wwR | w ε (0,1)*} [May-2016-OLD] [LJIET]
22 Draw the PDA for the following language. [May-2016-OLD] [LJIET] 7
L = { ai bj ck | i = j+k}
23 Write PDA for language of palindrome. Trace it with example.[Oct-2016-OLD] [LJIET] 7
24 Write PDA for the string with equal number of a’s and b’s. Trace it with example. [Oct- 7
2016-OLD] [LJIET]
Theory Of Computation (3160704) 2022-2023 Page 48
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

25 For the language L = { xcxr / x Є {a,b}* } design a PDA(Push Down Automata) and 8
trace it for string “abcba” .[May-2011-OLD] [LJIET]
26 For the language L = { xcxr | x Є {a,b}* } design a PDA(Push Down Automata) and 7
trace it for string “abcba”. [May-2017-OLD] [LJIET]

27 Write transition table for PDA recognizing following language: 7


{ ai bj ck | j = i or j = k }. [May-2017-OLD] [LJIET]

28 Define PDA. Draw a PDA for the following language 7


L = {0n1n| w ε(0,1) and n>= 0} [Nov-2017-OLD] [LJIET]
29 Draw the PDA for the following language 7
L = {ai bj ck | i =j+k} [Nov-2017-OLD] [LJIET]
30 Give formal definition of PDA. Give mathematical description of ‘acceptance of a string 3
by a PDA by empty stack’. [May-2017-OLD] [LJIET]
31 Convert the following grammar to a PDA: 7
I → a | b | Ia | Ib | I0 | I1
E → I | E * E | E + E | (E) [May-2017-OLD] [Aug-2021-OLD] [LJIET]
32 Using pumping lemma for CFL’s, show that the language L = {am bm cn | m ≤ n ≤ 2m} is 4
not context free. [May-2017-OLD] [LJIET]
33 For the language L = { xcxr | x Є {a,b}* } design a PDA(Push Down Automata). [Nov- 4
2017-OLD] [Aug-2021-OLD] [LJIET]
34 Design a PDA to recognize the language generated by the following grammar: 4
S → 0AB
A → 1A | 1
B → 0B | 1A | 0
Show the acceptance of the input string string “011100“ by this PDA. [May-2018-OLD]
[LJIET]
35 Prove that L = {anbncn | n ≥ 0 } is not a CFL using pumping lemma. [May-2018-OLD] 3
[LJIET]
36 Consider following PDA machine M = ({p, q}, {0,1}, (x, z}, δ, q, Z) where δ is given by 4
δ(q, 1, z) = (q, xz)
δ(q, 1, x) = (q, xx)
δ(q, ^, x) = (q,^)
δ(q, 0, x) = (p, x)
δ(p, 1, x) = (p, ɛ)
δ(p, 0, z) = (q, z)
Construct Equivalent CFG. [May-2018-OLD] [LJIET]
37 Design DPDA for the language L that accepts strings with more a’s than b’s. Trace String 7
“abbabaa”. [May-2018-OLD] [LJIET]
38 Construct pushdown automata for the following language: 7
L = {the set of strings over alphabet {a, b} with exactly twice as many a’s and b’s }
Trace string “abaabbaaa”. [May-2018-OLD] [LJIET]
39 Define PDA and give PDA to accept strings of palindrome. Show trace on the string 7
baab. [NOV-2018-OLD] [LJIET]
40 Define deterministic pushdown automata. Construct an example of DPDA that accepts 7
strings with more a’s than b’s. [NOV-2018-OLD] [LJIET]
41 A language L {a, b}* is defined as follows: 7
1. a ϵ L
2. For any x ϵ L, ax ϵ L
3. For any x and y in L, all the strings bxy, xby and xyb are in L
Theory Of Computation (3160704) 2022-2023 Page 49
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

4. No other strings are in L.


Prove that every element of L has more a’s than b’s. [NOV-2018-OLD] [LJIET]
42 Construct PDA for 4
S → 0AB
A → 1A | 1
B→ 0B | 1A | 0
Trace the string 01011 using PDA. [May-2018-OLD] [LJIET]
43 Give transition tables for deterministic PDA recognizing following language: 7
L = {x ϵ {a, b}* | na(x) ≠ nb(x)}
Trace it for the string abbaababbb [May-2018-OLD] [LJIET]
44 Show using pumping lemma that the given language is not a CFL. 3
L = { anb2nan | n ≥ 0}[May-2018-OLD] [LJIET]
45 Prove that There are CFLs L1 and L2 so that L1 ∩ L2 is not a CFL, and there is a CFL 4
L so that L’ is not a CFL. [May-2018-OLD] [LJIET]
46 For the PDA, ( {q0, q1}, {0, 1}, {0, 1, z0}, δ, q0, z0, ϕ ), 7
where δ is
δ(q0, ɛ, z0) = {(q1, ɛ)}
δ(q0, 0, z0) = {(q0, 0z0)}
δ(q0, 0, 0) = {(q0, 00)}
δ(q0, 1, 0) = {(q0, 10)}
δ(q0, 1, 1) = {(q0, 11)}
δ(q0, 0, 1) = {(q1, ɛ)}
δ(q1, 0, 1) = {(q1, ɛ)}
δ(q1, 0, 0) = {(q1, ɛ)}
δ(q1, ɛ, z0) = {(q1, ɛ)}
Obtain CFG accepted by the above PDA. [May-2018-OLD] [LJIET]
47 Define PDA. Describe the pushdown automata for language {0n1n | n≥ 0}.[Nov-2018- 7
OLD] [LJIET]
48 Explain push down automata with example and their application in detail.[Nov-2018- 7
OLD] [LJIET]
49 Compare PDA with FSM.[May-2019-OLD] [LJIET] 3
50 Write a note on DPDA and NPDA. [May-2019-OLD] [Aug-2021-OLD] [LJIET] 4
51 Design PDA for the language L = { xcxr | x ε {a, b}* } [May-2019-OLD] [LJIET] 7

52 Define PDA. Give DPDA for CFG S →SS | [S] | {S} | Λ [Dec-2019-OLD] [LJIET] 7
53 Give Bottom Up PDA for following CFG, 7
(1) S →S+T | T
(2) T →T * a | a [Dec-2019-OLD] [LJIET]
54 Give transition table for PDA accepting the language of all odd-length strings over {a, b} 7
with middle symbol a. Also draw a PDA for the same. [Dec-2019- OLD] [LJIET]
55 Convert the following CFG into its equivalent PDA. 3
S → AB A → BB B → AB A → a
B→a|b
. [Dec-2019- OLD] [LJIET]
56 Show using the pumping lemma that the following language is not a CFL. 4

Theory Of Computation (3160704) 2022-2023 Page 50


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

[Dec-2019-OLD] [LJIET]
57 Define Pushdown Automata. [Nov-2021-NEW][LJIET] 3
58 Design a PDA to accept L = {xcy | x, y∈ (a,b)* and |x| = |y|}. [Nov-2021-NEW][LJIET] 4
59 Design a PDA to accept L = {an bn | n>=0}. [Nov-2021-NEW][LJIET] 4
60 Define - A Pushdown Automaton and acceptance by a PDA. [Jan-2021-OLD] [LJIET] 3
61 Convert the CFG with following productions into its equivalent PDA. [Jan-2021-OLD] [LJIET] 4
S → [S] | SS | ^
62 Design a PDA to accept L = {wcwR | w ∈ (a,b)*}[Jan-2021-OLD] [LJIET] 7,4
OR
Design a PDA to accept L = {xcxr | x ∈ (a,b)*}. [Jun-2022-OLD] [LJIET]
63 Discuss pumping lemma for context free languages.[Jan-2021-OLD] [LJIET] 3
64 Design a PDA to accept L = {xcy | x, y∈ (a,b)* and |x| = |y|}.[Jan-2021-OLD] [LJIET] 7
65 Differentiate Turing machine, PDA and FA with example. [Jan-2021-OLD][Jun-2022-OLD] 7
[LJIET]
66 Draw the PDA for the following language[Jan-2021-OLD] [LJIET] 7
L = {aibjck| i = j+k}
67 Develop a DPDA that accepts following language: [Oct-2020-OLD] [LJIET] 7
𝐿 = {𝑥 ∈ {𝑎, 𝑏}∗ | 𝑛𝑎(𝑥) > 𝑛𝑏(𝑥)}
68 Explain push down automata with example. [Aug-2021-OLD][LJIET] 4
69 Design PDA for L={x∈xr/x∈{a,b}*}. The string in L are odd length palindromes over 7
{a,b}. [Aug-2021-OLD][LJIET]
70 Design a deterministic PDA Accepting “Balance string of brackets”. [Aug-2021- 7
OLD][LJIET]
71 How are DPDA and NPDA different? Show which is more powerful than the 7
other and capable of accepting languages which the other cannot. [Dec-2022-
OLD][LJIET]
72 Write and explain the pumping lemma for CFL. [Dec-2022-OLD][LJIET] 7
73 Find the CFG for the regular expression : (011+1)∗ (01)∗ [Dec-2022-OLD][LJIET] 4
74 Convert the following CFG into CNF. [Dec-2022-OLD][LJIET] 7
S → bA | aB
A → bAA | aS | a
B → aBB | bS | b
75 Define Pushdown Automata. [Dec-2022-OLD][LJIET] 3
76 Construct a PDA equivalent to the following CFG. [Dec-2022-OLD][LJIET] 4
S -> 0BB
B -> 0S | 1S | 0
77 Design the pushdown automata for language {0n1n|n≥ 0}[Dec-2022-OLD][LJIET] 7
78 Suppose the PDA M = ({q0, q1}, {a, b, c}, {a, b, Z0}, δ, q0, Z0, {q1}) has 3
the following transition functions
1. δ(q0, a, Λ) = (q0, a)
2. δ(q0, b, Λ) = (q0, b)
3. δ(q0, c, Λ) = (q1, Λ)
4. δ(q1, a, a) = (q1, Λ)
5. δ(q1, b, b) = (q1, Λ)
Show the acceptance of abbcbba by the above PDA. [Dec-2022-OLD][LJIET]

79 Prove that L = {anbncn | n ≥ 1} is not a CFL. [Dec-2022-OLD][LJIET] 4


80 Design deterministic PDA accepting strings with more a’s than b’s. 7
[Dec-2022-OLD][LJIET]
Theory Of Computation (3160704) 2022-2023 Page 51
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

81 What is Instantaneous Description? Construct the pushdown automata 7


over Σ = {a,b} for the language L = {an c bn / n>=1}. [Dec-2022-NEW][LJIET]
82 Define the following operations for Push Down Automata: PUSH, POP, 3
and SKIP. [Dec-2022-NEW][LJIET]
83 Give transition table for deterministic PDA recognizing the following 7
language.
{ an bn+m am | n,m ≥ 0) [Jun-2022-OLD][LJIET]
84 State the pumping lemma for Context Free Language[Jun-2022-OLD][LJIET] 3
85 Define PDA. Convert the CFG with following productions into its 7
equivalent PDA. [Jun-2022-OLD][LJIET]
07
S → [S] | SS | ^
86 Design a PDA to accept L = { X / Na(X) = Nb(X) , X ∈ {a,b}*}[Jun-2022- 4
OLD][LJIET]
87 What is a pushdown automaton? Explain}*}[Jun-2022-NEW][LJIET] 3
88 Give the difference between top down and bottom up parsing. [Jun-2022- 4
NEW][LJIET]
89 Design and draw deterministic PDA Accepting “Balance string of brackets” [Jun-2022- 7
NEW][LJIET]
90 Explain deterministic pushdown automata. [Jun-2022-NEW][LJIET] 3
91 Explain conversion from PDA to CFG[Jun-2022-NEW][LJIET] 4
92 Design and draw PDA to accept string with more a’s than b’s. [Jun-2022- 7
NEW][LJIET]
UNIT NO- 5 : Turing Machine (TM)
TOPIC:1:TM Definition, Model Of Computation And Church Turning
Thesis, computing functions with TM, Combining TM, Variations Of
TM, Non Deterministic TM, Universal TM, Recursively and
Enumerable Languages, Context sensitive languages and Chomsky
hierarchy
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 What is a turing machine? [LJIET] 01
Answer: Turing machine is a simple mathematical model of a computer. TM has
unlimited and unrestricted memory and is a much more accurate model of a general
purpose computer. The turing machine is a FA with a R/W Head. It has an infinite tape
divided into cells ,each cell holding one symbol.
2 What are the applications of TM? [LJIET] 01
Answer: TM can be used as:
Recognizers of languages.
Computers of functions on non negative integers. Generating devices.
3 What are the various representation of TM? [LJIET] 01
Answer: We can describe TM using:
Instantaneous description.
Transition table.
Transition diagram.
4 What are the techniques for Turing machine construction? [LJIET] 01
Answer: • Storage in finite control.
• Multiple tracks.
• Checking off symbols.
Theory Of Computation (3160704) 2022-2023 Page 52
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

• Shifting over
• Subroutines.
5 What is a multi-tape Turing machine? [LJIET] 01
Answer: A multi-tape Turing machine consists of a finite control with k-tape heads and
k- tapes ; each tape is infinite in both directions. On a single move depending on the state
of finite control and symbol scanned by each of tape heads ,the machine can change state
print a new symbol on each cells scanned by tape head, move each of its tape head
independently one cell to the left or right or remain stationary.
6 What are UTMs or Universal Turing machines? [LJIET] 01
Answer: Universal TMs are TMs that can be programmed to solve any problem, that can
be solved by any Turing machine. A specific Universal Turing machine U is:
Input to U: The encoding “M “ of a Tm M and encoding “w” of a string w. Behavior : U
halts on input “M” “w” if and only if M halts on input w.
7 State the halting problem of TMs. [LJIET] 01
Answer: The halting problem for TMs is:
Given any TM M and an input string w, does M halt on w?
This problem is undecidable as there is no algorithm to solve this problem.
8 What properties of recursive enumerable seta are not decidable? [LJIET] 01
Answer: Emptiness
Finiteness
Regularity
Context-freedom.
9 Is it true that the language accepted by a non-deterministic Turing machine is different 01
from recursively enumerable language? [LJIET]
Answer: No, the language accepted by non-deterministic Turing machine is same as
recursively enumerable language.
10 What are recursively enumerable languages? [LJIET] 01
Answer: The languages that is accepted by TM is said to be recursively enumerable (r. e
) languages. Enumerable means that the strings in the language can be enumerated by the
TM. The class of r. e. languages include CFL’s.
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Write Short Note on Following: 3
(i) Universal TM OR Write a short note on Universal Turing Machine
OR
Discuss universal Turing machine
OR][May-2019-OLD][Nov-2021-OLD] [LJIET]
2 Write short note on Universal Turing Machine.[Jan-2013-OLD][Dec-2013-OLD][May- 3,7
2016-OLD][NOV-2018-OLD][Jun-2022-OLD] [LJIET]
3 Explain Universal Turing Machine.[Dec-2015][Oct-2016-OLD][May-2018- 3.5,7,4
OLD][LJIET]
4 Define Turing Machine. Describe its capabilities. Also write short notes on Universal 5
Turing Machine.[May-2011-OLD] [LJIET]
5 Write Short note on Following: 6
(i) Halting Problem
(ii) Church Turing Thesis [May-2015-OLD] [LJIET]
6 Design a Turing Machine to copy strings. [Dec-2015-OLD] [LJIET] 7
7 Define Turing Machine. Draw TM for accepting Palindrome Strings in {a,b}*. [Dec- 7
2015-OLD] [LJIET]
8 Write TM accepting Palindrome. 7
Theory Of Computation (3160704) 2022-2023 Page 53
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

OR
Draw a transition diagram for a Turing machine for the language of all palindromes over {a,
b}. [June-2013-OLD][May-2018-OLD] [LJIET]
9 Draw the TM to copy string and delete a symbol. [May-2014-OLD] [LJIET] 7
10 Write a Turing Machine to copy strings. [Aug-2021-OLD] [LJIET] 7
OR
Draw a TM to copy strings. [Dec-2014-OLD][Oct-2016-OLD] [LJIET]
OR
Design Turing Machine to copy string. [May-2019-OLD] [LJIET]
11 Write a Turing Machine to delete a symbol.[Dec-2014-OLD] [LJIET] 7
12 Draw a transition diagram for a Turing machine accepting the following language { x є 7
{ a, b, c }* | na(x) = nb(x) = nc(x) }.[Nov-2011-OLD] [LJIET]
13 Draw a transition diagram for a Turing machine accepting the following language. 7
{ an bn cn | n ≥ 0 }.[Nov-2011-OLD ][Oct-2016][ Jun-2022-OLD] [LJIET]
14 Draw the TM for L = {ss | s ∈ (a, b)* }. 7
OR
Draw a TM to accept { ss | s є {a,b}* }.OR Draw a transition diagram for a Turing
machine accepting the language {SS | S ϵ {a, b}*}. [May-2012-OLD][June-2013-
OLD][Oct-2016-OLD][ May-2018-OLD] [LJIET]
15 Explain Universal TM and Church Turing Thesis.[May-2012-OLD] [LJIET] 7
16 Draw the TM which recognize words of the form { an bn cn | n>=1}.[ May-2016-OLD] 7
[LJIET]
17 Explain Universal Turing Machine and Church Turing Hypothesis.[May-2016-OLD] 7
[LJIET]
18 Explain Universal Turing machine with the help of an example.[Oct-2016-OLD] 7
[LJIET]
19 Explain Universal Turing Machine and Halting Problem. [Dec-2014-OLD][Dec-2015- 7
OLD] [LJIET]
20 Define a Turing Machine. Design a Turing machine for deleting nth symbol from a 7
string w from the alphabet Σ = {0,1}.[May-2016-OLD] [LJIET]
21 Draw Turing Machine(TM) which recognizes words of the form { anbncn | n≥ 1 } 8
[May-2015-OLD] [LJIET]
22 Design Turing Machine(TM) to accept Palindrome over {a,b}, even as well as odd. 8, 7
[May-2015-OLD] [May-2016] [May-2019-OLD] [LJIET]
23 Draw a Turing Machine(TM) to accept Palindromes over {a,b}. (Even as well as Odd 8,7
Palindromes) .[May-2011-OLD][Jan-2013-OLD][Dec-2013-OLD][Oct-2016-OLD]
[LJIET]
24 Draw a Turing Machine(TM) to accept Palindromes over {a,b}. (Even as well as Odd 7
Palindromes). OR Draw a transition diagram for a Turing machine for the language of all
palindromes over {a, b}. [May-2017-OLD][Nov-2017][Nov-2018-OLD] [Aug-2021-
OLD] [LJIET]
OR
Draw Turing Machine (TM) accepting Palindrome over {a,b}. [Dec-2019-OLD] [Nov-
21-New] [LJIET]

Draw a transition diagram for a Turing machine for the language of all palindromes over
{a, b}. [Dec-2022-OLD][LJIET]
25 Write a short note on Universal Turing Machine. [May-2017-OLD] [Nov-2017-OLD] 4,7
[Nov-2017-OLD] [Aug-2021-OLD] [Jun-2022-OLD] [LJIET]

Theory Of Computation (3160704) 2022-2023 Page 54


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

26 Write a Turing Machine to copy strings. [May-2017-OLD] [Nov-2017] [LJIET] 7


27 Define a Turing Machine. Design a Turing machine for deleting nth symbol from a string 7
w from the alphabet Σ ={0,1}. [Nov-2017-OLD] [LJIET]
28 Give definition of Turing Machine. What do you mean by an instantaneous description 3
of a Turing Machine? [May-2017-OLD] [LJIET]
29 Design a Turing machine to accept the language {0n1n | n ≥ 1}. [May-2017-OLD] 7
[LJIET]
30 Design a Turing machine for the language over {0,1} containing strings with equal 7
number of 0’s and 1’s. [May-2017-OLD] [LJIET]
31 Design a Turing Machine that creates a copy of its input string. Trace String “baa”. [May- 7
2018-OLD] [LJIET]
32 Design a Turing Machine which recognizes words of the form anbncn | n ≥ 1. Trace string 7
“aabbcc”. [May-2018-OLD] [LJIET]
33 Define Turing Machine and draw a TM to accept {a,b}*{aba}{a,b}* [NOV-2018-OLD] 7
[LJIET]
34 Write Short note on Church-Turing Thesis. OR Write a short note on church-turing 4
thesis. [May-2018-OLD] [Nov-2018] [Aug-2021-OLD] [Nov-2021-OLD] [Dec-2022-
OLD][LJIET]
35 What is Turing Machine? Write advantages of TM over FSM.[Nov-2018] [Aug-2021- 3
OLD] [Aug-2021-OLD] [LJIET]
36 Describe recursive languages and recursively enumerable languages.[Nov-2018-OLD] 4
[LJIET]
37 Define grammar and chomsky hierarchy.[Nov-2021-NEW] [Aug-2021-OLD] [LJIET] 3
OR
Explain Chomsky Hierarchy. [Nov-2018-OLD][May-2018-OLD] [LJIET]
38 Give the formal definition of Turing machine. Also compare the power of DFA, NFA, 3
DPDA, NDPA and TM[May-2019-OLD][LJIET]
39 Write a note on post machines.[May-2019-OLD][LJIET] 4
40 Design a Turing machine to reverse the string over alphabet {0, 1} 7
[May-2019-OLD][LJIET]
41 Compare and contrast push down automata and Turing machine. 3
[May-2019-OLD][LJIET]
42 Enlist limitations of Turing machines. [May-2019-OLD] [Aug-2021-OLD] [LJIET] 4
43 Design a Turing machine which accepts the language consisting string which contain aba as 7
a substring over alphabets {a, b}[May-2019-OLD][LJIET]
44 Write a short note on Halting problem[May-2019-OLD][LJIET] 4
45 What is decidability? How to prove that the given language is undecidable? List some 7
undecidable problems. [May-2019-OLD][LJIET]
46 Draw Turing Machine (TM) accepting {SS | S ∈ {a,b}*} 7
OR
Draw a Turing Machine that accepts the language {xx | x ∈{a,b}∗}. Also trace the TM on
input string aa. [Dec-2019-OLD][Dec-2019-OLD][LJIET]
47 Discuss – Nondeterministic Turing Machines and Universal Turing Machines. 4
[Dec-2019-OLD][LJIET]
48 Draw a Turing Machine that accepts the language 7

. Also trace the TM on input string


aaabbbaaa. [Dec-2019- OLD][LJIET]
49 7

Theory Of Computation (3160704) 2022-2023 Page 55


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

[Nov-2021-NEW][LJIET]
50 Discuss - universal Turing machine. [Jan-2021-OLD][LJIET] 4
51 Draw Turing machine for L = {xx | x ∈ {a, b}*}. Also trace out the same on input string 7
aba. [Jan-2021-OLD][LJIET]
52 Discuss chomsky hierarchy. [Jan-2021-OLD][LJIET] 3
53 Draw Turing machine to accept language L = {x ∈ {a, b}* | x ends with aba}. 7
Also trace out the same on input string aba. [Jan-2021-OLD][LJIET]
54 Write Short note on Universal Turing Machine. [Jan-2021-OLD][LJIET] 7
55 Define a Turing Machine. Design a Turing machine for deleting nth symbol from a string 7
w from the alphabet Σ = {0,1}.[Jan-2021-OLD][LJIET]
56 Draw Turing machine which accept palindrome language.[Jan-2021-OLD][LJIET] 7
57 Define a Turing Machine.[Oct-2020-OLD][LJIET] 3
58 Draw a Turing Machine to accept a regular language.[Oct-2020-OLD][LJIET]
{a, b}*{aba}
59 Develop a Turing Machine to accept even length palindromes over {a,b}*.[Oct-2020- 7
OLD][LJIET]
60 Develop a Turing Machine that creates a copy of its input string to the right of the input 7
but with a blank space separating the copy from the original. [Oct-2020-OLD][LJIET]
61 What important points do we derive from Church-Turing thesis? [Oct-2020- 4
OLD][LJIET]
62 Design a TM for accepting Palindromes for odd and even length. [Aug-2021- 7
OLD][LJIET]
63 Explain Halting Problem with suitable example. [Nov-2021-OLD][LJIET] 7
64 Draw a Turing Machine to accept a regular language {a,b}*{baa}{a,b}*[Dec-2022- 7
OLD][LJIET]

65 Draw a Turing Machine to reverse a string. [Dec-2022-OLD][LJIET] 7


66 Write a note on multi-tape Turing Machines. [Dec-2022-OLD][LJIET] 7
67 Enlist limitations of Turing machines. [Dec-2022-OLD][LJIET] 3
68 Design a Turing machine to reverse the string over alphabet {0, 1}. 7
[Dec-2022-OLD][LJIET]
69 Write a short note on Halting problem.[Dec-2022-OLD][Jun-2022-OLD][LJIET] 3,4
[LJIET]
70 Discuss Universal Turing Machine. .[Dec-2022-OLD][LJIET] 3
71 Enlist and explain the operations performed by tape in turing machine[Dec-2022- 3
NEW][LJIET]
72 Discuss universal turing machine with example. [Dec-2022-NEW][LJIET] 4
73 Write down 7-tuple definition for the turing machine. 7
Construct the turing machine and its transition table over Σ = {a,b} for the
language L = {anbn / n>=1}.[Dec-2022-NEW][LJIET]
74 Construct Turing Machine to delete one letter from an alphabetic input String. 7
[Jun-2022-OLD][LJIET]
75 Define Turing Machine.[Jun-2022-OLD][LJIET] 3
76 Develop a Turing Machine to accept palindromes over {a,b}*[Jun-2022-OLD][LJIET] 7
77 Develop a Turing Machine to accept the language L = {WW / W ∈ {a,b}*}[Jun-2022- 7
OLD][LJIET]
78 What is Turing machine? Explain its capabilities. [Jun-2022-NEW][LJIET] 3
79 Explain Church Turing thesis. [Jun-2022-NEW][LJIET] 4
80 Design a Turing machine to copy a string. [Jun-2022-NEW][LJIET] 7
81 Explain Universal Turing machine[Jun-2022-NEW][LJIET] 4
Theory Of Computation (3160704) 2022-2023 Page 56
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

82 Design a Turing machine to delete a symbol. [Jun-2022-NEW][LJIET] 7


UNIT NO- 6 : Computable Functions
TOPIC:1: Partial, total, constant functions, Bounded Mineralization,
Minimalization
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 When we say a problem is decidable? [LJIET] 01
Answer: A problem whose language is recursive is said to be decidable. Otherwise the
problem is said to be undecidable.
2 Define constant functions [LJIET] 01
Answer: A constant function is a function whose (output) value is the same for every
input value.
3 Define: Composition [LJIET] 01
Answer: There are two operations that make new functions from old: composition and
primitive recursion. Composition replaces the arguments of a function by another.
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Answer the following 3.5
(i) Explain time and space complexity [Dec-2015-OLD] [LJIET]
2 Explain Halting Problem.[Dec-2015-OLD] [LJIET] 3.5
3 Show that the uncomputability of the given busy-beaver function implies the 7
unsolvability of the halting problem. Busy Beaver function, b : N → N as follows,
b(0) is 0. For n > 0, b(n) is obtained by considering TMs having n non halting states
and tape alphabet {0, 1} .[Nov-2011-OLD] [LJIET]
4 Define:[May-2014-OLD] [LJIET] 7
[1] Basic complexity Classes
[2] Primitive Recursive Functions
[3] The Time and Space Complexity of a Turing Machine
5 Explain unbounded minimization and μ recursive functions. [Dec-2014-OLD] [LJIET] 7
6 Write Short note on Following: 7
(i) Halting Problem
(ii) Primitive Recursive Function.[May-2016- OLD ] [ LJIET]
7 Define Constant functions, Successor functions and Projection function. [May-2018- 3
OLD] [LJIET]
8 Write Short note on Following: 7
(i) Halting Problem
(ii) Church Turing Thesis [May-2019-OLD] [LJIET]
9 Explain Time Complexity and Space Complexity. [May-2019-OLD] [LJIET] 7
10 Explain unbounded minimization and μ recursive functions [Dec-2019-OLD] [LJIET] 7
11 Define Bounded Minimalization of a predicate P. [Oct-2020-OLD][LJIET] 3
12 Define Bounded Minimalization [Dec-2022-OLD][Dec-2022-NEW] [LJIET] 3,4
TOPIC:2: Primitive Recursive Functions, Regular function, μ-
Recursive Functions, Quantification, All Computable Functions Are μ-
Recursive
Sr. SHORT QUESTIONS (1 Mark) / MCQ / True-False/Fill in the blanks Marks
No
1 Which of the following is not primitive recursive but partially recursive? [LJIET] 01
a)Carnot function
b)Rieman function
Theory Of Computation (3160704) 2022-2023 Page 57
L.J. Institute of Engineering & Technology Semester: VI (2022-23)

c)Bounded function
d)Ackermann function
Answer: d
2 Define: Regular function [LJIET] 01
Answer: In algebraic geometry, a morphism between algebraic varieties is a function
between the varieties that is given locally by polynomials. It is also called a regular map.
A morphism from an algebraic variety to the affine line is also called a regular function.
3 Define: Primitive Recursive Functions [LJIET] 01
Answer: In computability theory, primitive recursive functions are a class of functions
that are defined using primitive recursion and composition as central operations and are a
strict subset of the total µ-recursive functions (µ-recursive functions are also called
partial recursive).
4 Define: μ Recursive Functions [LJIET] 01
Answer: A function is μ-recursive if it can be built up using the base functions and the
operations of composition, primitive recursion and unbounded minimization.
5 Define: Ackermann’s function [LJIET] 01
Answer: Ackermann’s function is a famous function that is not primitive recursive. It is
defined by:A(0, y) = y + 1
A(x, 0) = A(x − 1, 1)
A(x, y + 1) = A(x − 1,A(x, y))
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Show that the function f1(x,y) = x + y is primitive recursive. 2,3,7
OR
Prove that following add(x,y) = x+y is primitive recursive function. [May-2015-
OLD,May 2016-OLD, May-2018-OLD] [LJIET]
2 Write short note on Primitive Recursive Functions. [Jan-2013-OLD] [LJIET] 4,7
OR
Explain Primitive recursive Function. OR Explain primitive recursive function by suitable
example. [Dec-2013-OLD,Oct-2016-OLD, Nov-2018-OLD] [LJIET]
3 Explain the following 7
1. Primitive Recursive Operation & Function.
2.μ Recursive Functions.[June-2013-OLD] [LJIET]
4 Write theorem: Let f: Σ*1 Σ*2. Then f is computable if and only if f is μ recursive. 7
[June-2013-OLD] [LJIET]
5 Give definitions of the following.[Nov-2011-OLD][LJIET] 7
[1] Initial Functions
[2] Composition
[3] The Primitive Recursive Functions
6 Define functions by Primitive Recursion. Show that the function f(x, y) = x + y is 7
primitive recursive.[Oct-2016-OLD] [ LJIET]
7 Write a short note on μ-recursive function. [May-2017-OLD] [Nov-2017-OLD] 7
[LJIET]
8 Prove that following add(x,y) = x+y is primitive recursive function. [Nov-2017-OLD] 7
[LJIET]
9 Describe recursive languages and recursively enumerable languages. [May-2017-OLD] 4
[LJIET]
10 Briefly describe following terms: (1) halting problem (2) undecidable problem. [May- 3
2017-OLD] [LJIET]

Theory Of Computation (3160704) 2022-2023 Page 58


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

11 Show that the function f(x, y) = x*y is primitive recursive. [MAY-2018-OLD] [LJIET] 3
12 Define Primitive Recursive Function. Show that Addition function of two positive 3.5
integers is primitive recursive. [MAY-2018-OLD] [LJIET]
13 Prove the theorem: “A language is recursive if and only if both it and its complement are 3
recursively enumerable”. [MAY-2018-OLD] [LJIET]
14 Define - Primitive recursive functions and also give complete primitive recursive 4
derivations for the function, f∶N →N defined by Add(x,y)=x+y.
[Dec-2019- OLD] [LJIET]
15 Discuss Recursive definition. Also define the language L defined by the 3
following recursive definition over ∑ = {a, b}:
^ ∈ L; For every x ∈ L, xa, bx, and abx are in L;
Nothing else is in L. [Jan-2021-OLD] [LJIET]
16 Discuss primitive recursive function using proper example. [Jan-2021-OLD] [LJIET] 4
17 Write a note on Bounded Minimalization. [Dec-2022-OLD][LJIET] 7
18 State the following functions: Partial, Constant and Total. [Dec-2022-NEW][LJIET] 3
19 Explain Primitive Recursive Functions. [Jun-2022-NEW][LJIET] 3
UNIT NO- 7 : Undecidability
TOPIC:1:A Language That Can’t Be Accepted, and a Problem That
Can’t Be Decided Non Recursive Enumerable (RE) Language,
Undecidable Problem with RE, Undecidable Problems about TM,
Undecidable Problems Involving Context-Free Languages, The Class P
and NP, Post‘s Correspondence Problem
Sr. DESCRIPTIVE QUESTIONS Marks
No
1 Explain in Brief: Halting Problem.[May-2011-OLD ,Jan-2013-OLD] [LJIET] 3
2 Write Short Note on following: 7
(i) Halting Problem
(ii)Explain P and NP Completeness [May-2018-OLD] [LJIET]
3 Write Short note on Any Two : 7
(i) The Primitive Recursion Function
(ii) P and NP Completeness
(iii) Equivalence Relation [MAY-2018-OLD] [LJIET]
4 Explain following terms 7
1) P and NP Completeness
2) Time and Space Complexity [Dec-2019-OLD] [LJIET]
5 Write Short Note on Following: 3
(ii) NP-Hard and NP-Complete Language [May-2015-OLD][LJIET]
6 Explain in Brief: 1) Basic complexity Classes. 7
2) P and NP completeness [June-2013-OLD ,Dec-2013-OLD] [LJIET]
7 Answer the following (ii) Explain P and NP completeness.[Dec-2015-OLD] [LJIET] 3.5
8 Explain in Brief: 1) Basic complexity Classes. [Jan-2013-OLD] [LJIET] 3
9 Write short note on the Sets P, NP, Pspace and NPSpace.[Jan-2013-OLD ,Dec-2013- 4
OLD] [LJIET]
10 Explain the following Term: P and NP Completeness. [May-2011-OLD][LJIET] 3
11 Give definitions of the following.[Nov-2011-OLD][LJIET] 7
[1] Polynomial-time Reducibility
[2] NP-hard and NP-complete languages
[3] The Sets P, NP, PSpace and NPSpace

Theory Of Computation (3160704) 2022-2023 Page 59


L.J. Institute of Engineering & Technology Semester: VI (2022-23)

12 Give definitions of the following.[Nov-2011-OLD][LJIET] 7


[1] Basic complexity Classes
[2] Step-counting Functions
[3] The Time and Space Complexity of a Turing Machine
14 Explain the following 7
1. Time and space complexity.
2. NP complete problem.[June-2013-OLD] [LJIET]
15 Explain Polynomial Time Reductions and NP- Completeness. [May-2014-OLD] 7
[LJIET]
16 Answer the following: [Dec-2014-OLD] [LJIET] 7
(i) Explain time and space complexity
(ii) Explain P and NP completeness
17 Explain P, NP and NP complete problem.[Oct-2016-OLD] [LJIET].[Dec-2022- 7,4
NEW][LJIET]
18 Differentiate the NP Hard and NP Complete Problems.[May-2012-OLD] [LJIET] 7
19 Discuss - recursively enumerable languages.[Jan-2021-OLD] [LJIET] 3
20 Explain Undecidable problem about TM[LJIET] 7
21 Explain Post’s Correspondence Problem.[Dec-2022-NEW][LJIET] 7
22 Define P, NP, NP-Hard and NP-Complete problem? [Nov-2021-OLD][LJIET] 4
23 Define the following terms: Recursive language, and Recursive Enumerable Language. .[Dec- 3
2022-NEW][LJIET]
24 Describe: Recursive function. Prove that every recursive function is Computable .[Dec-2022- 7
NEW][LJIET]

Theory Of Computation (3160704) 2022-2023 Page 60

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy