cs381-fall03-prelim1-solutions - CS381 Fall 2003 First Mid...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS381 First Mid Term Solution Friday Oct 10, 2003 Fall 2003 Olin 255 9:05-9:55 This is a 50-minute 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
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '05
  • Formal language, Formal languages, Regular expression, Regular language, Pumping lemma for regular languages

{[ snackBarMessage ]}

Ask a homework question - tutors are online