Contents
Prev
Next
Page+10
What is the simplest regular expression that generates the same
language as (a|b)*b*(a|b)+b+
- A: (a|b)+b+
- B: b*(a|b)+b+
- C: (a|b)*(a|b)+b+
- D: (a|b)+
- E: (a|b)+b
Answer: E
We can do this in steps as:
- (a|b)*b*(a|b)+b+
- (a|b)*(a|b)+b+ (a|b)* can absorb b*
- (a|b)+b+ (a|b)+ can absorb (a|b)*
- (a|b)+b*b b+ = b*b
- (a|b)+b (a|b)+ can absorb b*