Docsity

Practice Problems 1 - Organization Programming Languages | CMSC 330, Assignments of Programming Languages

Toggle sidebar
bg1
CMSC 330
Practice Problems 1
1. Describe the languages denoted by the following regular expressions:
(a) 0(0|1)∗0
(b) ((|0)1∗)∗
(c) (0|1)∗0(0|1)(0|1)
2. Write regular expressions, DFAs, and NFAs for the following languages.
(a) All strings of 0’s and 1’s that begin in 1.
(b) All non-empty strings of 0’s and 1’s that end in 1.
(c) All strings of 0’s and 1’s that contain the substring 00.
(d) All strings of 0’s and 1’s that do not contain the substring 00.
Substring is any contiguous sequence of characters found in a string.
3. For the regular expressions (a|b)∗and (a∗|b∗)∗
(a) Construct an NFA using the construction algorithm presented in class
(b) Show the sequence of moves in parsing ”ababbab”

Partial preview of the text

Download Practice Problems 1 - Organization Programming Languages | CMSC 330 and more Assignments Programming Languages in PDF only on Docsity!

CMSC 330

Practice Problems 1

  1. Describe the languages denoted by the following regular expressions:

(a) 0(0|1)∗ 0 (b) (( |0)1∗)∗ (c) (0|1)∗0(0|1)(0|1)

  1. Write regular expressions, DFAs, and NFAs for the following languages.

(a) All strings of 0’s and 1’s that begin in 1. (b) All non-empty strings of 0’s and 1’s that end in 1. (c) All strings of 0’s and 1’s that contain the substring 00. (d) All strings of 0’s and 1’s that do not contain the substring 00. Substring is any contiguous sequence of characters found in a string.

  1. For the regular expressions (a|b)∗^ and (a∗^ |b∗)∗

(a) Construct an NFA using the construction algorithm presented in class (b) Show the sequence of moves in parsing ”ababbab”