Gujarat Technological University
Gujarat Technological University
___________
OR
(c) Draw the given NFA in Table-1 and convert it to FA and identify the language.
07
q0 is the initial state and q1 is the accepting state.
Q.3 (a) Draw NFA lambda for the given regular expression:
03
(0)* (00 + 11)* (001) (01 + 10)
(b) Explain the Pumping Lemma for Context Free Languages. 04
(c) Convert the following grammar to CNF.
S → ABA
07
A → aA | ϵ
B → bB | ϵ
OR
Q.3 (a) Find the ꓥ-closure of a set of states for each state of the given NFA lambda in
03
Figure-1.
(b) What are non-CFLs? Give at-least two examples of non-CFLs. 04
(c) Show Bottom Up Parsing of the string “id + id * id” using the following grammar.
E→E+T|T 07
T→T*F|F
1
F → (E) | id
Q.4 (a) Define PDA. State whether a PDA can accept a CFL or not. 03
(b) Discuss the closure properties of CFLs. 04
(c) For the given Turing Machine in Table-2, trace the transition for the strings 1011
and 10101 and identify the language recognized by this TM. TM is defined as TM
07
= (Q, Σ, Γ, q0, δ ) where {q0,q1,q2,q3,q4,q5,q6} ∈ Q, Σ = {0,1}, {0,1,X,Y,B} ∈ Γ,
q0 ∈ Q, B ∈ Γ , B ∉ Σ, {q6} is the accepting state.
OR
Q.4 (a) Compare NPDA with DPDA. 03
(b) Show that if there are strings 𝑥 and 𝑦 in the language 𝐿 so that 𝑥 is a prefix of 𝑦
04
and 𝑥 ≠ 𝑦, then no DPDA can accept 𝐿 by empty stack.
(c) Draw a TM for the Language of strings with balanced parenthesis “(” and “)”
only. 07
Q.5 (a) When can we say that the language is decidable or undecidable? 03
(b) Draw only the transition table of Turing Machine to accept the language 𝐿 = 04
{0𝑛 1𝑛 : 𝑤ℎ𝑒𝑟𝑒 𝑛 ≥ 1}
(c) Define: Bounded Minimalization and show that, if P is a primitive recursive (𝑛 + 07
1) place predicate, its bounded minimalization 𝑚𝑃 is a primitive recursive
function.
OR
Q.5 (a) When can the language be called a recursive language or a recursively enumerable 03
language?
(b) Show that a Turing Machine to recognize the language 𝐿 = 𝐿(0∗ 1) can accept 04
the string without moving the head in L direction.
(c) Define: 𝜇-Recursive functions and show how all computable functions are 𝜇 - 07
recursive.
Table-1 Table-2
𝛿(𝑞, 0) 𝛿(𝑞, 1) State 0 1 X Y B
𝑞0 {𝑞0 , 𝑞1 } {𝑞1 }
𝑞0 (𝑞1, 𝑋, 𝑅) (𝑞2, 𝑌, 𝑅) (𝑞6, 𝑋, 𝑅) (𝑞6, 𝑌, 𝑅) (𝑞6, 𝐵, 𝑅)
𝑞1 {ø} {𝑞0 , 𝑞1 }
𝑞1 (𝑞1, 0, 𝑅) (𝑞1, 1, 𝑅) (𝑞3, 𝑋, 𝐿) (𝑞3, 𝑌, 𝐿) (𝑞3, 𝐵, 𝐿)
Figure-1
=======xx===========xxxxxxxxxxx=======xx======xxxxxxxxxx=============xx=====