Theoretical Computer Science - Spring 2012: Sample Test 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

27/03/12

lcbb.ep.ch/tcs12/test1-sample.html

Theoretical Computer Science -- Spring 2012


Sample Test 1
The first test is on diagonalization, finite automata, regular languages, and regular expressions. It will be given Tuesday, April 3rd. We will use the auditorium, because we need the number of seats. Time for the test will be 90 minutes -- we will start the course as usual at 8:15, use the first 15mins for any last questions, then start the test at 8:30, lasting until 10:00. We will have an exercise session as usual, but it will be a lecture to replace the lecture "lost" to the test. The test is open-book, open-notes. Since your notes may be on your laptop, you may bring a laptop, but you must turn off any wireless means of communication (and your phone must be off). There are five questions, all worth the same number of points. All have short answers. (Note: on the "real" test, questions will be given in both French and English; you can answer them in either language as well.) When asked for a proof, you should give a simple constructions (e.g., show how to construct the FA), use a known method (e.g., pumping lemma), or use known results (e.g., closure properties of regular languages). The alphabet for all languages below is {0,1}. Prove that, if a language L is regular, then so is the language { x | x=y0, where y is in L }. Prove that, if a language L is regular, then so is the language L' defined as follows. If x is a string in L, then let yx be the string composed of just the 0s of x (remove the 1s from x and concatenate the pieces); L' is the set of all such yx . (For example, if x=01101000101011, then yx =0000000; if x=11111, then yx is the empty string; etc.) Is the following language regular? Prove (give an FA) or disprove (use the pumping lemma or closure properties). L = { xy | |x|=|y| and x, y in {0,1}* } Is the following language regular? Prove (give an FA) or disprove (use the pumping lemma or closure properties). L = { x | |x| = 2k for some positive integer k } Give a regular expression for the language consisting of all strings in which every pair (if any) of consecutive 0s appears before any pair (if any) of consecutive 1s. A separate file holds the solutions.

lcbb.ep.ch/tcs12/test1-sample.html

1/1

You might also like