CS402 Solution
CS402 Solution
111=
a.
exact one b and can have any number of a’s (excluding none) before it, over the
Write the regular expression for language consists of all strings that ends and have
SOLUTION:
Where:
a+: Represents one or more occurrences of a.
b: Represents exactly one b at the end.
a) If the regular expression is (𝑎𝑏)*, how many different strings of length 4 are in this
language?
b) If the regular expression is (𝑎∣𝑏)2, how many strings of length 2 can it generate?
If the regular expression is (𝑎𝑏∣𝑏𝑎)2, how many distinct strings of length 4 can be generated?
SOLUTION:
Final Answers:
(a): 1 string.
(b): 4 strings.
(c): 4 strings.