Theory of Automata
Assignment #2
Part #1
Regular Expression # 1
The set of strings over {A..Z,a..z} that contain the word "main".
Let <letter> = A | B | ... | Z | a | b | ... | z <letter>* main <letter>*
Regular Expression # 2
The set of strings over {A..Z,a..z} that contain 3 x's.
<letter>* x <letter>* x <letter>* x <letter>*
Regular Expression # 3
The set of strings over {a,b} that even number of a's and odd number of b's.
((a+b)(a+b))*b+(b)((a+b)(a+b))*
Regular Expression # 4
The set of strings over {a,b} that contain no combination of ba
a*b*
Regular Expression # 5
The set of strings over {a,b} that contain consecutive two ab
(a+b)*abab(a+b)*
(a+b)*abab(a+b)*
Comments
Post a Comment