Theory of Automata
Theory of Automata
CS402
Assignment #01
VU Id: bc240203013
a. Write the regular expression for language consists of all strings that ends and
have exact one b and can have any number of a’s (excluding none) before it,
over the set of alphabets Σ={a,b}.
Solution:
a+b.
Solution:
Question#2:
Consider the language L of strings, defined over ∑= {a, b}, Write the answers of
the following:
a) If the regular expression is (𝑎𝑏)*, how many different strings of length 4 are
in this language?
Solution:
This regular expression represent zero or more repetitions of the string “ab”.
Solution:
This regular expression allow two characters where each character can
independently be either ‘a’ or ‘b’. Here | operator represent a choice between ‘a’ or
‘b’.
Total number of strings of length 2 is 2*2=4 because each characters has 2 choices
(‘a’ or ‘b’).
Solution: