complete the following regular expressions 1 in English desc
complete the following regular expressions
1 in English describe the language defined by the regular expression b*ab*a
2 Write a regular expression that represents the set of strings over {a,b} in which there are odd number of a\'s
Solution
Question:
1 in English describe the language defined by the regular expression b*ab*a
Answer:
In regular expression * represent 0 or more so the exoression is saying :
\'b\' can occur 0 or more times then \'a\' shoud come then agin b can occur 0 or more time then a shoud come
like(baba,bbbbbbaa,abba ,aa baa,)etc.
means a string with even number at least 2 a
question2:
Write a regular expression that represents the set of strings over {a,b} in which there are odd number of a\'s
Answer:
b*ab*(ab*ab*)*
this will match odd numbers of a in string
