Theory of Computation Final Exam: Denumerability, Automata, and Complexity, Exams of Theory of Computation

A final exam for a course on the Theory of Computation. The exam consists of four questions that cover topics such as denumerable sets, regular languages, and context-free languages. Each question requires students to provide detailed answers and explanations. The exam is closed-book and has a duration of 3h30.

Typology: Exams

2015/2016

Uploaded on 05/11/2023

shahid_88c
shahid_88c 🇺🇸

4.4

(26)

261 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to the
Theory of Computation
Final exam
19 August 2016
Closed-book. Duration: 3h30.
Please answer each question on a separate sheet with your name and
section. Motivate all your answers and give sufficient details.
1. a) Is an infinite subset of a set that is non-denumerable necessarily
non-denumerable?
b) Is the union of two denumerable sets necessarily denumerable?
c) Show, using a cardinality argument, that there must exist uncom-
putable functions from Nto N.
2. a) Give a DFA that accepts the language
L1 tw|wP ta, bu˚, Napwq 2 mod 4u
where Nσpwqis the number of letters σcontained in the word w.
b) Give a DFA that accepts the language
L2 tw|wP ta, bu˚, aa RF actpwqu
c) Give a regular grammar that generates L1YL2.
3. a) Using the pumping lemma, show that the language ta3nbnc˚|nP
Nuis not regular.
b) Let L1and L2be two regular languages over the same alphabet
Σ. Is the language L1L2that contains the words that belong
to only one of the two languages regular?
4. a) Is the language L taibjck|ijor jkwhere i, j, k ě0u
context-free?
b) Show that the intersection of two context-free languages is not
necessarily context-free. Use this to deduce that the complement
of a context-free language is not necessarily context-free. Give
a sufficient criterion for the intersection of two context-free lan-
guages to be context-free.
1
pf2

Partial preview of the text

Download Theory of Computation Final Exam: Denumerability, Automata, and Complexity and more Exams Theory of Computation in PDF only on Docsity!

Introduction to the

Theory of Computation

Final exam

19 August 2016

Closed-book. Duration: 3h30. Please answer each question on a separate sheet with your name and section. Motivate all your answers and give sufficient details.

  1. a) Is an infinite subset of a set that is non-denumerable necessarily non-denumerable?

b) Is the union of two denumerable sets necessarily denumerable? c) Show, using a cardinality argument, that there must exist uncom- putable functions from N to N.

  1. a) Give a DFA that accepts the language

L 1 “ tw | w P ta, bu˚, Napwq “ 2 mod 4u

where Nσpwq is the number of letters σ contained in the word w. b) Give a DFA that accepts the language

L 2 “ tw | w P ta, bu˚, aa R F actpwqu

c) Give a regular grammar that generates L 1 Y L 2.

  1. a) Using the pumping lemma, show that the language ta^3 nbnc˚^ | n P Nu is not regular. b) Let L 1 and L 2 be two regular languages over the same alphabet Σ. Is the language L 1 ‘ L 2 that contains the words that belong to only one of the two languages regular?
  2. a) Is the language L “ taibj^ ck^ | i “ j or j “ k where i, j, k ě 0 u context-free?

b) Show that the intersection of two context-free languages is not necessarily context-free. Use this to deduce that the complement of a context-free language is not necessarily context-free. Give a sufficient criterion for the intersection of two context-free lan- guages to be context-free.

  1. a) For a Turing machine M, define the notions of configuration, deriva- tion, execution, accepted language and decided language.

b) Give a Turing machine that decides the language L “ tanb^2 n^ | n ě 0 u defined over the alphabet Σ “ ta, c, bu. Explain briefly the role of each state of the Turing machine.

  1. a) Define primitive recursive functions.

b) Show that the function SumSquarespnq, that computes the sum of the squares from 0 up to n (e.g. SumSquaresp 3 q “ 02 12 22 ` 32 ), is primitive recursive.

  1. Let M be a Turing machine and q one of its states. Show that the problem that consist in determining whether there exists a word such that M stops in state q is undecidable. Hint: Use the existential halting-problem.
  2. a) Consider L P N P. Show that there exists a deterministic Turing machine M and a polynomial ppnq such that M decides L and has a time complexity bounded by 2ppnq.

b) State Cook’s theorem and explain its importance.