100% found this document useful (9 votes)
3K views22 pages

JFLAP Homework Assignment Overview

This document contains the descriptions of several formal language problems assigned as homework for a course on computational theory. The problems involve describing languages with regular expressions and constructing deterministic finite automata (DFAs) to recognize various strings based on properties like symbol counts and substring patterns.

Uploaded by

Nuhbody
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (9 votes)
3K views22 pages

JFLAP Homework Assignment Overview

This document contains the descriptions of several formal language problems assigned as homework for a course on computational theory. The problems involve describing languages with regular expressions and constructing deterministic finite automata (DFAs) to recognize various strings based on properties like symbol counts and substring patterns.

Uploaded by

Nuhbody
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

CS340 Homework Assignment 1 using JFLAP

1. which strings (0001, 01001, 0000110) are accepted by the dfa in figure 2.1 0001 = Accept 01001 = Accept 0000110 = Reject

2(a) L = { all strings with exactly one a}

2(b) L = { all strings with at least one a}

2(d) L = { all strings with at least one a and exactly two bs}

2(e) L = { all strings with exactly 2 as and more than two bs}

5.(b) L = { abnam : n >= 2, m >=3 }

5.c)

L = { w1 ab w2 : w1 {a,b}*, w2 {a,b}* }

6. With = {a,b}, give a dfa for L = {w1 a w2 : |w1| =3, |w2| <=5 }

7. (b) L = { w : |w| mod 5 != 0}

7.c)

L = { w : Na(w) mod 3 > 1}

7(e) L = { w: ( Na(w) Nb(w) ) mod 3 > 0}

7(f) L = { w: ( Na(w) + 2* Nb(w) ) mod 3 < 2}

8.(a) L = {w : w contains no runs of length less than four}

8(b) L = {w : w every run of as has length either 2 or 3}

8.c)

L = {w : there are at most two runs of as of length 3}

8(d) L = {w : there are exactly two runs of as of length 3}

9.(b) L = { all strings containing 00 but not 000}

9.c) L = { all strings in which the first (leftmost) symbol differs from the last (rightmost)}

9(e) L = { all strings of length 3 or more in which the second symbol from the right is different from the leftmost symbol}

9(f) L = { all strings which the leftmost two symbols and the rightmost two symbols are identical}

9(G) L = { all strings of length four or greater in which the leftmost three symbols are the same but different from the rightmost symbol}

10. Construct a DFA that accepts strings on {0,1} if and only if the value of the string interpreted as a binary representation of an integer is zero modulo five. For example, 0101 and 1111 (5 and 15) are accepted.

CS340
Homework Assignment 1 using JFLAP
1. which strings (0001, 01001, 0000110) are accepted by the dfa in figure 2.1
0001 =
2(b) L = { all strings with at least one a}
2(d) L = { all strings with at least one a and exactly two b’s}
2(e) L = { all strings with exactly 2 a’s and more than two b’s}
5.(b) L = { abnam  : n >= 2, m >=3 }
5.c)
L = { w1 ab w2 : w1 ∈  {a,b}*, w2 ∈{a,b}* }
6. With ∑ = {a,b}, give a dfa for L = {w1 a w2 : |w1| =3, |w2| <=5 }
7. (b) L = { w : |w| mod 5 != 0}
7.c)
L = { w : Na(w)  mod 3 > 1}
7(e) L = { w: ( Na(w) – Nb(w) ) mod 3 > 0}

You might also like