

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 2
This page cannot be seen from the preview
Don't miss anything!


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.
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.
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.
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.
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.
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.
b) State Cook’s theorem and explain its importance.