DOC PREVIEW
UMD CMSC 330 - Regular Expression and Finite Automata Practice Problems

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CMSC 330: Regular Expression and Finite Automata PracticeProblems1. For each of the following regular expressions, write down three strings in the language generated bythe expression, and give a short English description of the language. AssumeP= {0, 1}.(a) 0+(0 ∪ 1)1+(b) 0*10*10*10*(c) 0*(100*)*1*(d) ( 0 ∪ 10 )*1( 1 ∪ 10 )*2. Consider sets of binary strings A = {0, 00, 000} and B = {11}. Show the language denoted by each ofthe following:(a) A0(b) A1(c) A ∪ A2(d) AB2(e) (AB)2(f) B3(g) A∗(h) (A ∪ B)23. For each of the following problems construct a deterministic finite automaton which describes or rec-ognizes the language given. The underlying alphabet isP= {0, 1}. Be sure to give DFAs and notNFAs. Do not use any notational conveniences or shortcuts given in lecture.(a) { w | w begins with 01 and ends with 01. }(b) { w | w has an even number of 1’s. }(c) { w | w has two or three 1’s. }(d) { w | w has an even number of 0’s, and |w| is even. }(e) { w | w has an even number of 0’s and odd number of 1’s. }1(f) { w | w contains the substring 110. }(g) { w | w does not contain the substring 110. }(h) { w | w does not contain neither of the substrings 11 and 00. }(i) { w | w has exactly one occurence of the substring 010. }(j) { w | w has n occurences of 0’s where n mod 5 is 3. }4. For each of the following problems, assumeP= {a, b}.(a) Convert the following NFA to a DFA.(b) Write a regular expression that accepts the language defined by 4a.(c) Conver the following NFA to a DFA.(d) For each of the following strings, determine whether it is recognized by 4c or not.i. babii. aababbbiii. aabbaaaaiv. aabaaav. bbaabbab2vi. aabba5. Construct a NFA that accepts C-like comment delimited by /* and */. Do not handle nested comments(assume they are not allowed). For simplicity, useP= {/, ∗, c} where c is the only (non-comment)character in the language. Then, Write a regular expression for the NFA you contructed.6. Let L be a regular language. Prove that R(L), strings in L reversed, is also a regular


View Full Document

UMD CMSC 330 - Regular Expression and Finite Automata Practice Problems

Documents in this Course
Exam #1

Exam #1

6 pages

Quiz #1

Quiz #1

2 pages

Midterm 2

Midterm 2

12 pages

Exam #2

Exam #2

7 pages

Ocaml

Ocaml

7 pages

Parsing

Parsing

38 pages

Threads

Threads

12 pages

Ruby

Ruby

7 pages

Quiz #3

Quiz #3

2 pages

Threads

Threads

7 pages

Quiz #4

Quiz #4

2 pages

Exam #2

Exam #2

6 pages

Exam #1

Exam #1

6 pages

Threads

Threads

34 pages

Quiz #4

Quiz #4

2 pages

Threads

Threads

26 pages

Exam #2

Exam #2

9 pages

Exam #2

Exam #2

6 pages

Load more
Download Regular Expression and Finite Automata Practice Problems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Regular Expression and Finite Automata Practice Problems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Regular Expression and Finite Automata Practice Problems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?