


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Fall, 2001 Prof. R. Fateman
CS 164 Midterm 1: September 26, 2001, 9:00AM
Read all instructions carefully. There are 7 questions in the exam on 4 pages. Some questions have multiple parts. You have 50 minutes to complete this test. The exam is closed book but you may refer to your one page (2-sides) handwritten 8.5 by 11 inch paper. Please write your answers in the space provided. You may use the backs of the exam pags for scratch space. Solutions will be graded on correctness. Partial credit will be given.
Question Grade Out of 1 20 2 5 3 6 4 5 5 10 6 12 7 2 Total 60
State Transitions Final state? 0 1 S S, T S T T yes
c. In the space below, draw a DFA that accepts the same language. Use as few states as possible.
d. Write a context free grammar G0 that describes the same language.
b. Under what condition is First(W) โ First(X)?
c. Under what condition is ฮต โ First(X)?
S ร aS S ร b
i m p o c $ E TX TX X pE (^) โ โ T iY oEc Y mT (^) โ โ โ
c. Trace each stack configuration in the parsing of the input string to i c$. We have given you the first stack contents:
step stack input
b. How many CS164 lectures were delivered without the use of the video projector?