3.
a) L1 = {anbm: n>= 4, m<= 3}
So we can have a's as among these {aaaa, aaaaa, aaaaaa, .... ...}
and b's as {,b, bb, bbb}
the DFA for L1 will be
hence the regular expression will be - aaaa(a*)(+b + bb + bbb)
b) As the complement of the above DFA will be
So the regular expression will be -
( + a + aa + aaa)( + b(a + b)*) + aaaaa*(b + bb )a(a + b)* + aaaaa*bbb(a + b)(a + b)*
c) L2 = {w : |w| mod 3 0}
|w| mod 3 can be either 0,1, or 2
for |w| mod not equal to 0, |w| can be 1,2,4,5,7,8,10,11,...
The dfa will be
hence the RE will be : (a+b)+((a+b)(a+b))+((a+b)(a+b)(a+b)(a+b))*+((a+b)(a+b)(a+b)(a+b)(a+b))*
d) here the dfa will be :
hence the RE : ((a+b)(a+b)(a+b))*
e)
The nfa for this language would be
hence the RE is:
aa(bb)*+bb(aa)*
3" (25%) Give regular expressions for the following languages on {a, b). (a) L,-(a"b": n 4, m 3) ...
4) (9 pts) Give regular expressions for the following languages on (la, b) a) L1 = { w : na(w) mod 3 = 1). b) L2w w ends in aa) c) L3 = all strings containing no more than three a's.
HW03 - 1 to 4 Problem 1 Find a regular expression for the set ^a"bm: (n + m) is odd Problem 2 Give regular expressions for the following languages. 3. The complement of L 4. The complement of L2 Problem 3 Find a regular expression for L = {w: na(w) and nb(w) are both even } Problem 4 Find dfa's that accept the following languages A. L-L(ab a)UL((ab) ba)
Give the regular expressions of the following languages (alphabet is ab): a. {w | w has a length of at least three and its second symbol is a b} b. {w | w begins with an a and ends with a b} c. {w | w contains a single b} d. {w | w contains at least three a's} e. {w | w contains the substring baba} d. {w | w is a string of even length} e. The empty...
Give regular expressions describing each of the following regular languages over Σ = {0,1}: {w : |w| = 3} (PLEASE SHOW WORK)
Give regular expressions describing each of the following regular languages over Σ = {0,1}: {w : w begins and ends with the same symbols} show work!
5. Prove that the following languages are not regular: (a) L = {a"bak-k < n+1). (b) L-(angla": kメn + 1). (c) L = {anglak : n = l or l k} . (d) L = {anb : n2 1} L = {w : na (w)关nb (w)). "(f) L = {ww : w E {a, b)'). (g) L = {w"www" : w E {a,b}*}
Regular expressions, DFA, NFA, grammars, languages Regular Languages 4 4 1. Write English descriptions for the languages generated by the following regular expressions: (a) (01... 9|A|B|C|D|E|F)+(2X) (b) (ab)*(a|ble) 2. Write regular expressions for each of the following. (a) All strings of lowercase letters that begin and end in a. (b) All strings of digits that contain no leading zeros. (c) All strings of digits that represent even numbers. (d) Strings over the alphabet {a,b,c} with an even number of a's....
give the regular expressions for each of the following languages u.{xy {a, b}* | the number of as in x is odd and the number of bs in y is even}
Prove that each of the following languages is not regular A) L= {a^n b^m c^k : k = 2n + 3m and n, m, k ≥ 0} B) L = {a^n : n is a power of 5}
Give English descriptions of the languages represented by the following regular expressions. The descriptions should be simple, similar to how we have been defining languages in class(e.g., “languages of binary strings containing 0 in even positions. . .”). Note: While describing your language, you don’t want to simply spell out the conditions in your regular expressions. E.g., if the regular expression is 0(0 + 1)∗, an answer of the sort “language of all binary strings that start with a 0”...