Gujarat Technological UniversitySummer 2023 examination

GTU 3160704 Theory of Computation (TOC) Summer 2023 Question Paper & PDF

B.E. · Computer Engineering · Semester 6 · Subject code 3160704
Download official PDFView PDF here
Share with your class
Total
70 marks
To pass
23 marks (33%)
Duration
2.5 Hours 10:30 AM – 1:00 PM
Questions
5 with internal choice
No solutions on this paper yetNeed them for your exam? Ask once. Papers that students ask for are solved first, and we aim to add them within 24 hours.

9 of 25 questions on this paper were also asked in other years. 4 more are types of question GTU sets again with new data. Each is marked below with the years it appeared.See all 34 repeated 3160704 questions, most asked first

Q.1

14 Marks
(a)
3 marks

Let f be a function from the set 𝐴 = {1,2,3,4} to 𝐵 = {𝑝, 𝑞, 𝑟, 𝑠} such that, 𝑓 = {(1, 𝑝)(2, 𝑝)(3, 𝑞)(4, 𝑠)}. Is 𝑓⁻¹ a function?

(b)
4 marks
𝐿 is defined recursively as follows:
1𝜖 ∈ 𝐿
2∀𝑥 ∈ 𝐿, both 0𝑥 and 0𝑥1 are in𝐿. Prove that: For every 𝑛 >= 0, every 𝑥 belongs to 𝐿 obtained by n applications of rule 2 is an element of L.
(c)
7 marksAsked in 2 of 7 papers

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 states in its FA?

Also asked in Summer 2025 Q1c

Q.2

14 Marks
(a)
3 marks
Define: Grammar.
(b)
4 marks

What are similarities and differences between Moore machines and Mealy machines?

(c)
7 marks
Given two languages 𝐿1 and 𝐿2, defined as:

𝐿1 = {𝑥 | 𝑎𝑙𝑙 𝑥 𝑠𝑡𝑎𝑟𝑡 𝑤𝑖𝑡ℎ 𝑎𝑏𝑎 } 𝐿2 = {𝑥 | 𝑎𝑙𝑙 𝑥 𝑒𝑛𝑑𝑠 𝑖𝑛 𝑏𝑏} 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.

(c)
7 marksSame type asked in 3 of 7 papers

Draw the given NFA in Table-1 and convert it to FA and identify the language. q0 is the initial state and q1 is the accepting state.

State𝛿(𝑞, 0)𝛿(𝑞, 1)
𝑞0{𝑞0, 𝑞1}{𝑞1}
𝑞1{ø}{𝑞0, 𝑞1}

Also asked in Winter 2025 Q2c, Winter 2025 Q2c OR, Summer 2025 Q2c

Q.3

14 Marks
(a)
3 marksSame type asked in 4 of 7 papers
Draw NFA lambda for the given regular expression:
0* (00 + 11)* (001) (01 + 10)

Also asked in Summer 2025 Q2c OR, Summer 2024 Q2c OR, Winter 2023 Q4b OR

(b)
4 marksAsked in 4 of 7 papers
Explain the Pumping Lemma for Context Free Languages.

Also asked in Winter 2025 Q4a, Summer 2025 Q4a, Winter 2023 Q4a

(c)
7 marksSame type asked in 7 of 7 papers
Convert the following grammar to CNF.
S → ABA
A → aA | ϵ
B → bB | ϵ

Also asked in Summer 2026 Q3c OR, Winter 2025 Q5c OR, Summer 2025 Q3c OR, Winter 2024 Q4c OR, Summer 2024 Q3c OR, Winter 2023 Q4c OR

(a)
3 marksSame type asked in 2 of 7 papers

Find the ꓥ-closure of a set of states for each state of the given NFA lambda in Figure-1.

GTU Theory of Computation (3160704) Summer 2023 Question 3 OR (a) Diagram

Also asked in Winter 2024 Q2a

(b)
4 marks
What are non-CFLs? Give at-least two examples of non-CFLs.
(c)
7 marks
Show Bottom Up Parsing of the string “id + id * id” using the following grammar.
E → E + T | T
T → T * F | F
F → (E) | id

Q.4

14 Marks
(a)
3 marksAsked in 5 of 7 papers
Define PDA. State whether a PDA can accept a CFL or not.

Also asked in Winter 2025 Q4b OR, Summer 2025 Q2a, Winter 2024 Q3a, Winter 2023 Q4a OR

(b)
4 marks
Discuss the closure properties of CFLs.
(c)
7 marks

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 = (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.

State01XYB
𝑞0(𝑞1, 𝑋, 𝑅)(𝑞2, 𝑌, 𝑅)(𝑞6, 𝑋, 𝑅)(𝑞6, 𝑌, 𝑅)(𝑞6, 𝐵, 𝑅)
𝑞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, 𝑌, 𝑅)—
(a)
3 marksAsked in 2 of 7 papers
Compare NPDA with DPDA.

Also asked in Winter 2024 Q3b OR

(b)
4 marks

Show that if there are strings 𝑥 and 𝑦 in the language 𝐿 so that 𝑥 is a prefix of 𝑦 and 𝑥 ≠ 𝑦, then no DPDA can accept 𝐿 by empty stack.

(c)
7 marks

Draw a TM for the Language of strings with balanced parenthesis “(” and “)” only.

Q.5

14 Marks
(a)
3 marksAsked in 4 of 7 papers
When can we say that the language is decidable or undecidable?

Also asked in Winter 2025 Q3c OR, Winter 2024 Q5a, Summer 2024 Q5a

(b)
4 marksAsked in 2 of 7 papers

Draw only the transition table of Turing Machine to accept the language 𝐿 = {0𝑛1𝑛: 𝑤ℎ𝑒𝑟𝑒 𝑛 ≥ 1}

Also asked in Summer 2024 Q4c

(c)
7 marksAsked in 3 of 7 papers

Define: Bounded Minimalization and show that, if P is a primitive recursive (𝑛 +

1place predicate, its bounded minimalization 𝑚𝑃 is a primitive recursive function.

Also asked in Summer 2026 Q4a OR, Winter 2025 Q5a

(a)
3 marksAsked in 3 of 7 papers

When can the language be called a recursive language or a recursively enumerable language?

Also asked in Winter 2025 Q3b OR, Winter 2024 Q5a OR

(b)
4 marks

Show that a Turing Machine to recognize the language 𝐿 = 𝐿(0∗1) can accept the string without moving the head in L direction.

(c)
7 marksAsked in 2 of 7 papers

Define: 𝜇-Recursive functions and show how all computable functions are 𝜇 - recursive.

Also asked in Winter 2025 Q3a OR

More Theory of Computation papers

Questions repeat across sessions. Working through two or three papers shows you which topics GTU asks most.

Preparing with friends?

Send this paper to your class group. Every question has its own link.

About this paper

Official Gujarat Technological University (GTU) examination paper for Theory of Computation (TOC) (Summer 2023, B.E. · Computer Engineering, Sem 6). Features complete 70-mark regular & remedial examination pattern, official marking distribution across all 5 questions, and direct 1-click official PDF download.

Transcribed for student exam preparation from Gujarat Technological University official examination archives. Questions, syllabus guidelines, and curriculum marking schemes remain the intellectual property of Gujarat Technological University.

ViewDownload PDF