Theory of Computing
Homework 3
CS 3810, Fall 2009
Due Friday, September 18
Each problem should be submitted on a separate piece of paper.
Please put your netid on your
homework!
1.
Describe the set
{ } { } { } { }
22
010 1
1 *
0*1
01010 1
nn
εε
≥+
I
.
Why did we add
the term
{ }
ε
+
to the two subexpressions?
2.
a)
Write a regular expression for all strings of 0’s and 1’s having an even number of 0’s.
Does every string denoted by your expression have an even number of 0’s?
Is every string
with an even number of 0’s included in your regular expression?
b)
Write a regular expression for all strings of 0’s and 1’s in which all 0’s occur before any
1’s.
c)
Write a regular expression for all strings of 0’s and 1’s that are of odd length.
3.
a)
Write a regular expression for all strings of 0’s and 1’s in which the total number of zeros
to the right of each 1 is even.
b)
Write a regular expression for all strings of 0’s and 1’s in which at least one copy of the
substring 01 occurs before any copy of the substring 10 occurs in the string.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '07
 HOPCROFT
 Regular expression, Nondeterministic finite state machine, Parity, Evenness of zero, Theory of Computing

Click to edit the document details