Midterm Exam Sample. Time: 150 minutes - Computer Science
Midterm Exam Sample. Time: 150 minutes - Computer Science
Midterm Exam Sample. Time: 150 minutes - Computer Science
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
91.502 Foundations of <strong>Computer</strong> <strong>Science</strong> 1<br />
<strong>Midterm</strong> <strong>Exam</strong> <strong>Sample</strong>. <strong>Time</strong>: <strong>150</strong> <strong>minutes</strong><br />
This sample only gives you an idea of the difficulty level of the exam and topic coverage.<br />
Problems in the actual exams will be similar to what you have seen in the lectures and the<br />
textbook and what you have done in your homework assignments.<br />
The exam is closed book and contains five problems. Complete as many problems as you can,<br />
show your work, and justify your answers. Keep your answers clean and don’t include<br />
anything that is irrelevant. You will be graded not only on the correctness of your answer,<br />
but also on the clarity you express it.<br />
Problem Points Grade<br />
1 20<br />
2 20<br />
3 20<br />
4 20<br />
5 20<br />
Total 100<br />
I have abided by the Academic Honor Code on this exam.<br />
Signature:<br />
Date:<br />
Name (please print):<br />
UMass Lowell<br />
<strong>Midterm</strong> <strong>Exam</strong> <strong>Sample</strong>
91.502 Foundations of <strong>Computer</strong> <strong>Science</strong> 2<br />
1. (20 points) Use the technique of product automata to show that the intersection of a<br />
regular language and a context-free language is context-free.<br />
2. Consider ɛ-NFA M 0 = (Q, {0, 1}, δ, q 0 , F ) given below:<br />
δ ɛ 0 1<br />
→ A {B, E} ∅ ∅<br />
B ∅ ∅ C<br />
∗C ∅ C C<br />
E ∅ {E, F } E<br />
∗F ∅ ∅ ∅<br />
(a) (5 points) Convert M 0 to an equivalent DFA M 1 .<br />
(b) (5 points) Minimize M 1 to an equivalent DFA M 2 .<br />
(c) (5 points) Derive a regular expression for L(M 0 ) from M 2 .<br />
(d) (5 points) Construct a right-linear grammar from M 2 that generates L(M 0 ).<br />
3. Let L = {xx | x ∈ {0, 1} ∗ }.<br />
(a) (10 points) Show that L is not regular without using the Pumping Lemma.<br />
(b) (10 points) Show that L is not regular using the Pumping Lemma.<br />
4. (20 points) Show that context-free languages are not closed under intersection.<br />
5. (20 points) Show that a one-tape Turing machine can be simulated by a Pushdown<br />
Automaton with two (unbounded) stack memories.<br />
UMass Lowell<br />
<strong>Midterm</strong> <strong>Exam</strong> <strong>Sample</strong>