Please provide solution in detail. Thank you!! 1 Rewrite Systems Remember our re
ID: 3748196 • Letter: P
Question
Please provide solution in detail.
Thank you!!
Explanation / Answer
4) Regular Expressions
a) string will contains a's, b's, c's and no a should follow b, examples of these type of strings are:
aabbcc, ccccaaab, bcccca etc
regular expression will be : (a+b+c+) | (c+a+b+) | (b+c+a+)
string can be of any of the three type mentioned above in regular expression
+ denotes 1 or more occurence of the letter
eg c+ denotes 1 or more occurence of c
as in question it is mentioned that string should contain a, b ,c thats why we have used + in regular expression.
(a+b+c+) denotes a's followed by b's then b's followed by c's . It is acceptable.
or string can also be like below:
(c+a+b+) denotes c's followed by a's then a's followed by b's . It is acceptable.
or string can also be like below:
(b+c+a+) denotes b's followed by c's then c's followed by a's . It is acceptable.
Therefore we can mentioned all these with | (or) sign :
(a+b+c+) | (c+a+b+) | (b+c+a+)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.