Toc QB Even 2023
Toc QB Even 2023
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: 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
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)
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]
OR
Write the principle of Mathematical Induction. Prove using mathematical induction that
for every n≥0,
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)
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
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]
(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]
(i) (11+110)* 0
[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
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
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
.[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)
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
|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)
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
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]
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]
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]
[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} Ǿ
[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
48 Give recursive definitions of the extended transition functions, δ̂ ̂(i.e., for strings) for 4
DFA and NFA. [May-2017-OLD] [LJIET]
[May-2017-
OLD] [LJIET]
[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
62 Let M1, M2 and M3 be the FAs pictured in Figure, recognizing languages L1, L2 and 7
L3, respectively.
.[Nov-2018-OLD] [LJIET]
65 Minimize the given DFA:[May-2019-OLD][LJIET] 4
[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:
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)
[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]
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)
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)
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 → ε – 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:
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)
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)
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}
(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]
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
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]
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
[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]
• 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]
[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]
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]
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