0% found this document useful (0 votes)
96 views6 pages

Toc Summer 2022 Merged

This document outlines the examination structure for the Theory of Computation course at Gujarat Technological University for the Summer 2022, 2023, and 2024 semesters. It includes instructions, subject codes, and a series of questions covering topics such as finite automata, regular expressions, context-free grammars, pushdown automata, and Turing machines. Each question is designed to assess students' understanding of theoretical concepts and their practical applications.

Uploaded by

mambaraval
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)
96 views6 pages

Toc Summer 2022 Merged

This document outlines the examination structure for the Theory of Computation course at Gujarat Technological University for the Summer 2022, 2023, and 2024 semesters. It includes instructions, subject codes, and a series of questions covering topics such as finite automata, regular expressions, context-free grammars, pushdown automata, and Turing machines. Each question is designed to assess students' understanding of theoretical concepts and their practical applications.

Uploaded by

mambaraval
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/ 6

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–VI (NEW) EXAMINATION – SUMMER 2022
Subject Code:3160704 Date:01/06/2022
Subject Name:Theory of Computation
Time:10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.
MARKS
Q.1 (a) Define: Set, Subset, Complement 03
(b) Write and explain the principle of mathematical induction using 04
example.
(c) Draw Finite automata for following regular expression: 07
(i). (0 + 1)∗ (1 + 00)(0 + 1)∗
(ii). (111 + 100)∗ 0

Q.2 (a) Explain Regular language & Regular expressions 03


(b) Find a regular expression corresponding to each of the following 04
subsets of {0,1}*
(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
(c) Prove Kleene’s theorem part-1 07
OR
(c) Explain procedure to minimize finite automata 07

Q.3 (a) Define Context free grammar & context free language 03
(b) Write CFG for following 04
(i) L={aibjck | i=j or j=k}
(ii) L={aibjck | j>i+k}
(c) Convert following CFG to CNF : 07
S -> S(S)/^
OR
Q.3 (a) Define Regular grammar and give example. 03
(b) Explain types of derivation and ambiguity. 04
(c) Convert following CFG to CNF : 07
S->aX/Yb X->S/^ Y->bY/b

Q.4 (a) What is a pushdown automaton? Explain. 03


(b) Give the difference between top down and bottom up parsing. 04
(c) Design and draw deterministic PDA Accepting “Balance string of 07
brackets”
OR
Q.4 (a) Explain deterministic pushdown automata. 03
(b) Explain conversion from PDA to CFG. 04
(c) Design and draw PDA to accept string with more a’s than b’s. 07

1
Q.5 (a) What is Turing machine? Explain its capabilities. 03
(b) Explain Church Turing thesis. 04
(c) Design a Turing machine to copy a string. 07
OR
Q.5 (a) Explain Primitive Recursive Functions. 03
(b) Explain Universal Turing machine 04
(c) Design a Turing machine to delete a symbol. 07

*************************

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–VI (NEW) EXAMINATION – SUMMER 2023
Subject Code:3160704 Date:04-07-2023
Subject Name:Theory of Computation
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Marks

Q.1 (a) Let f be a function from the set 𝐴 = {1,2,3,4} to 𝐵 = {𝑝, 𝑞, 𝑟, 𝑠} such that, 𝑓 =
03
{(1, 𝑝)(2, 𝑝)(3, 𝑞)(4, 𝑠)}. Is 𝑓 −1 a function?
(b) 𝐿 is defined recursively as follows:
1. 𝜖 ∈ 𝐿
2. ∀𝑥 ∈ 𝐿, both 0𝑥 and 0𝑥1 are in𝐿. 04
Prove that: For every 𝑛 >= 0, every 𝑥 belongs to 𝐿 obtained by n applications
of rule 2 is an element of L.
(c) Discuss “Distinguishability” of one string from another and explain how it
affects the number of states in an FA. Considering the example of 𝐿 =
{𝑎, 𝑏}∗ {𝑎𝑏𝑎}, how do the distinguishable strings in L relate to the number of 07
states in its FA?

Q.2 (a) Define: Grammar. 03


(b) What are similarities and differences between Moore machines and Mealy
04
machines?
(c) Given two languages 𝐿1 and 𝐿2 , defined as:
𝐿1 = {𝑥 | 𝑎𝑙𝑙 𝑥 𝑠𝑡𝑎𝑟𝑡 𝑤𝑖𝑡ℎ 𝑎𝑏𝑎 }
𝐿2 = {𝑥 | 𝑎𝑙𝑙 𝑥 𝑒𝑛𝑑𝑠 𝑖𝑛 𝑏𝑏}
07
Write the regular expression for both the languages and construct FAs 𝑀1 and 𝑀2
such that 𝑀1 accepts 𝐿1 and 𝑀2 accepts 𝐿2 . Derive 𝐿1 ∩ 𝐿2 .

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, 𝐵, 𝐿)

𝑞2 (𝑞2, 0, 𝑅) (𝑞2, 1, 𝑅) (𝑞4, 𝑋, 𝐿) (𝑞4, 𝑌, 𝐿) (𝑞4, 𝐵, 𝐿)

𝑞3 (𝑞5, 𝑋, 𝐿) — (𝑞6, 𝑋, 𝑅) (𝑞6, 𝑌, 𝑅) —

𝑞4 — (𝑞5, 𝑌, 𝐿) (𝑞6, 𝑋, 𝑅) (𝑞6, 𝑌, 𝑅) —

𝑞5 (𝑞5, 0, 𝐿) (𝑞5, 1, 𝐿) (𝑞0, 𝑋, 𝑅) (𝑞0, 𝑌, 𝑅) —

Figure-1

=======xx===========xxxxxxxxxxx=======xx======xxxxxxxxxx=============xx=====

2
Enrolment No./Seat No_____________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–VI (NEW) EXAMINATION – SUMMER 2024
Subject Code:3160704 Date:15-05-2024
Subject Name:Theory of Computation
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.
Marks

Q.1 (a) Suppose A and B are sets, 𝑓 = 𝐴 → 𝐵 and 𝑔 = 𝐵 → 𝐴. If 𝑓(𝑔(𝑦)) = 𝑦 for 03


every 𝑦 ∈ 𝐵, then f is a _______ function and g is a ______ function. Give
reasons for your answers.
(b) Given three statements p, q and r. 𝑝: 𝑎 = 1, 𝑞: 𝑏 = 0, 𝑟: 𝑐 = 3. 04
𝑊𝑟𝑖𝑡𝑒 𝑡ℎ𝑒 𝑓𝑜𝑙𝑙𝑜𝑤𝑖𝑛𝑔 𝑠𝑡𝑎𝑡𝑒𝑚𝑒𝑛𝑡𝑠 𝑠𝑦𝑚𝑏𝑜𝑙𝑖𝑐𝑎𝑙𝑙𝑦, 𝑢𝑠𝑖𝑛𝑔 𝑝, 𝑞, 𝑟, ⋁, ⋀ , ¬ 𝑎𝑛𝑑 →
𝑜𝑛𝑙𝑦.
1. Either 𝑎 = 1 or 𝑏 ≠ 0.
2. 𝑏 = 0 , but neither 𝑎 = 1 𝑛𝑜𝑟 𝑐 = 3.
(c) Discuss3.pumping lemma for regular languages. 07
4.
Q.2 (a) Define Chomsky Normal Form of grammar. 03
5.
(b) Define a Moore machine. 04
6.
(c) Apply the rules and convert the given NFA-λ to FA. 07

OR
(c) Draw the NFA-λ for r = (0)11* + (101)* 0 and also construct the equivalent NFA 07
and FA for the same.
Q.3 (a) Given two languages L1 and L2 defined over Σ = {a, b}∗ , L1 accepts palindrome 03
strings and L2 accepts strings with equal number of 0’s and 1’s. Which one of these
languages is regular? Give reasons.
(b) Show how, if a pushdown automaton recognizes some language, then it is context 04
free.
(c) If a regular expression is given as (001)* (01 + 10). Apply the rules to construct a 07
regular grammar for this language.
OR
Q.3 (a) Construct a Finite Automata that accepts all strings containing 010 or 111 as sub- 03
string only.

1
(b) Apply pumping lemma to show that the language 𝐿 = {𝑎𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 0} is not 04
context free.
(c) Apply the rules and show step by step conversion of the following grammar to 07
CNF.
S → ASA | aB
A→B|S
B→b|ϵ
Q.4 (a) Define DPDA with clear definition of δ (transition function). 03
(b) Discuss intersection of CFLs with an example. 04
(c) Apply the rules and step by step create a Turing Machine to accept 𝐿 = {𝑎𝑛 𝑏 𝑛 } 07
OR
Q.4 (a) The language of DPDA is called DCFL. Explain whether this statement is true or 03
false.
(b) Discuss complement of CFLs with an example. 04
(c) Construct a Turing machine to accept even palindrome over Σ = {a,b}* 07

Q.5 (a) Explain the concept of undecidable problems. 03


(b) Discuss multi-tape Turing machine. 04
(c) Write a note on Primitive Recursive functions. 07
OR
Q.5 (a) A language is decidable if and only if some nondeterministic Turing machine 03
decides it. Explain the statement.
(b) Regular languages and CFLs are both decidable and Turing-recognizable. Explain 04
whether true or false.
(c) Define and explain Bounded Quantification. 07

*************

You might also like