Department of Computer Engineering
Academic Year 2022 | Semester-VI
Question Bank
3160704 – TOC Dixita Kagathara
Sr. Unit Question
1 5 Design a Turing Machine for following:
1. Even and odd (all) Palindromes over {a, b}
2. Turing Machine to copy strings.
3. Turing machine accepting the language {SS | S ϵ {a, b}*}
4. Turing Machine that accepts the language {xx | x ∈ {a,b}∗}. Also trace the TM on
input string aa.
5. Turing machine to reverse the string over alphabet {0, 1}
6. Turing machine which accepts the language consisting string which contain aba
as a substring over alphabets {a, b}
7. Turing Machine that accepts the language {anbn | n ≥0} over {a,b}∗}.
2 4 Define PDA and Design a PDA for following:
1. L = { xcxr | x belongs to {a,b}* } trace the move of the machine for input string
abcba
2. pushdown automata to check well-formed parenthesis.
3. Give transition table for PDA accepting the language of all odd-length strings over
{a, b} with middle symbol a. Also draw a PDA for the same.
4. L = {x ϵ {a, b}* | na(x) ≠ nb(x)}, Trace it for the string abbaababbb
5. Pushdown automata for language {0n1n | n≥ 0}
3 3 Convert CFG to CNF
S → aY | Ybb | Y S→0A0 | 1B1 | BB S → ASA | aB
X → /\ | a A→C A→B|S
Y → aXY | bb | Xxa B→S | A B→b|ε
C→S | ε
S → AaA | CA | BaB S → TU | V
A → aaBa | CDA | aa | DC T → aTb | Ʌ
B → bB | bAB | bb | aS U→ cU | Ʌ
C → Ca | bC | D V → aVc | W
D → bD | ɛ W → bW | Ʌ
4 2 Define NFA-Ʌ. Explain how to convert NFA-Ʌ into NFA and FA with
suitable example. OR Convert following NFA- Λ to FA
Department of Computer Engineering
Academic Year 2022 | Semester-VI
Question Bank
3160704 – TOC Dixita Kagathara
5 3 • Define: Parse tree, Ambiguous grammar
• When a CFG is called an ‘ambiguous CFG’?
• Show that following CFG are ambiguous.
S → a | Sa | bSS | SSb | SbS S→ABA, S →ABA
A→aA | ε, A →aA | Ʌ
B→bB | ε B →bB | Ʌ
Is given grammar
ambiguous? If so then
remove ambiguity
S→A|B S -> aB | bA S → aAS | a
A →aAb | aabb A -> a | aS | bAA A → SbA | SS | ba
B →abB | Ʌ B -> b | bS | aBB Derive left most and
For string aaabbabbba, right most derivation of
find Left most derivation string aabbaa using
and Right most given grammar.
derivation.
6 1 • Using Principle of Mathematical Induction, prove that for every n >= 1
n
Σ i = n (n+1) / 2
i=0
• Using Principle of Mathematical Induction, prove that for every n >= 1
n
Σ 1/i(i+1)= n/ (n+1)
i=1
• 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
• Prove by mathematical induction: for every n>=1, 1 + 3 + 5 + … + (2n - 1) = n2
7 5 Write a short note on Universal Turing Machine and Church-Turing Thesis.
8 3 Define Context Free Grammar.
Find context-free grammar for following languages:
1. L1={aibjck | i = j + k}
2. L2= (011+1)* (01)*
3. L3=(0+1)1*(1+(01)*)
4. L = a*b*
5. L={ aibjck | j=i or j=k
6. L=(011+1)∗ (01)∗
9 2 Draw a FA for following regular language.
1. (11+110)* 0
2. (0+1)*(10+11)
3. The language accepting strings ending with ‘a’
4. The language accepting strings ending with ‘abba’
5. Draw an FA that recognizes the language of all strings containing even no of 0’s
and even no of 1’s over Σ = {0,1}.
Department of Computer Engineering
Academic Year 2022 | Semester-VI
Question Bank
3160704 – TOC Dixita Kagathara
10 2 What are the applications of regular expressions and finite automata? OR
Find a regular expression corresponding to each of the following subsets
• The language of all strings that begin or end with 00 or 11.
• The language of all strings containing both 11 and 010 as substrings.
• Write RE for the languages of all Strings that do not end with 01.
• The language of all strings that begin or end with 00 or 11.
• The language of all strings beginning with 1 and ending with 0.
• Second last character as ‘a’
• Starting with ‘a’ and ending with ‘b’
11 1 Explain equivalence relation with example. OR
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.
a. R = {(1, 3), (3, 1), (2, 2)}
b. R = {(1, 1), (2, 2), (3, 3), (1, 2)}
c. R = ϕ OR
Explain reflexivity, symmetry, and transitivity properties of relations.
12 2 • Draw FA for following languages:
L1 = {w | 00 is not substring of w}
L2 = {w | w ends in 01}
Find FA accepting languages (i). L1 ∩ L2 and (ii). L1 U L2
• Let FA1 and FA2 be the FAs as shown in the figure recognizing the languages L1
and L2 respectively. Draw an FA recognizing the language, L1 U L2.
• Let M1, M2 and M3 be the FAs pictured in Figure, recognizing languages L1, L2
and L3, respectively. Draw FAs recognizing the following languages.
a. L1 U L2 b. L1 ∩ L3
Department of Computer Engineering
Academic Year 2022 | Semester-VI
Question Bank
3160704 – TOC Dixita Kagathara
13 5 What is Turing Machine? Write advantages of TM over FSM, push down automata and
compare the power of DFA, NFA, DPDA, NDPA and TM
also Enlist limitations of Turing machines
14 6 Explain primitive recursive function by suitable example. OR
Show that the function f(x, y) = x + y is primitive recursive.
15 1 Define one-to-one, onto and bijection function with example. OR
2
Check whether the function f: R+ -> R, f(x) = x is one to one and onto.