This preview shows page 1. Sign up to view the full content.
CS381
First Mid Term Solution
Friday Oct 10, 2003
Fall 2003
Olin 255
9:059:55
This is a 50minute in class closed book exam.
All questions are straightforward and you
should have no trouble doing them.
Please show all work and write legibly.
Thank you.
There are many ways to do each problem.
The answers given below are only one of
many possible solutions.
1.
Let L be the set of strings of 0’s and 1’s with an even number of 0’s.
Strings with zero
0’s have an even number of 0’s. Write a regular expression for L.
Answer:
(1*01*01*)*+1*
2.
Consider the set
{ } { }
22
010 1
1 * 01 010 1
1 *0*1
ii
≥≥
I
Write down a string of length 19 in the set.
Answer: 0100100001000000001
What is the length of the shortest string in the set of length greater than 19?
Answer: 19+16+1+32+1=69
4
8
16
32
010010 10 10 10 1
3.
Let
be a set of strings.
In each string in
delete every b immediately
This is the end of the preview. Sign up
to
access the rest of the document.
 Fall '05
 HOPCROFT

Click to edit the document details