سؤال

Set={a,b} and L7:"All words that begin with an a and end with a b" is given L7 can be defined by

a(a+b)*b

What is the meaning of "+" ? And, How to solve this problem ?

هل كانت مفيدة؟

المحلول

a       # first letter is always 'a'
(a+b)*  # zero or more sequence of letters 'a' or 'b' [one letter at time]
b       # last letter is always 'b'

Here + means or and then consequently, we have the below results:

ab
abb
abbb
aaab
abbbb
aaaab
abbbbb
aaaaab
.....
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top