2,249 views
1 votes
1 votes
Consider the language defined by the regular expression (a | b) * b+.

Which of the following regular expressions also define that language?
(i) (a*b+) | (b*b+)
(ii) (ab |bb)*b*
(iii) (a | b | ba)*b+
(a) i only (b) i & ii only
(c) iii only (d) All of these
Solution: Option (c)

 

Need explanation why not all? we can obtain only b by taking (a | b) null it also applies to a option then why not a?

2 Answers

Best answer
2 votes
2 votes

Given lang is (a + b) * b+ = {all strings ending with b}

a) (a*b+) + (b*b+)

This doesn't generate abab.

b) (ab + bb)*b*

This generate epsilon which is not in given Lang.

c) (a + b +ba)*b+

This generate all strings , ignore "ba" for a while, it became same as given regular expression.

selected by

Related questions

7 votes
7 votes
4 answers
1
Pranav Madhani asked Nov 19, 2017
3,443 views
Determine the minimum height of parse tree in CNF for terminal string of length w, which is constructed by using CFG G(a) log2|w|+1 (b) log2|w|(c) log2|w|−1 (d) None of...
0 votes
0 votes
1 answer
2
0 votes
0 votes
1 answer
3
Pranav Madhani asked Nov 17, 2017
854 views
Consider this grammar:S → SS | aHow many derivation trees are possible for a4?(a) 3 (b) 4(c) 5 (d) 6 how to generalize for any values if a^5 or a^7 is there any general...