edited by
2,022 views
2 votes
2 votes

Consider the following grammar:

$S \rightarrow XY$

$X \rightarrow YaY \mid a \text{ and } Y \rightarrow bbX$

Which of the following statements is/are true about the above grammar?​​​​​​

  1. Strings produced by the grammar can have consecutive three $a$’s.
  2. Every string produced by the grammar have alternate $a$ and $b$.
  3. Every string produced by the grammar have at least two $a$’s.
  4. Every string produced by the grammar have $b$’s in multiple of $2$.
  1. i only
  2. ii and iii only
  3. iv only
  4. iii and iv only
edited by

3 Answers

1 votes
1 votes

Answer. 4:(c) and (d) only

It generates strings which contains b multiple of 2 and no of a at least 2.

0 votes
0 votes

Grammar generate a string abba.

  This is satisfied by option  c and d.  But option a and b are not satisfied.  

So option c and d is right. 

0 votes
0 votes

option D) is correct , as

  1. Every string produced by the grammar have at least two aa’s, it is true
  2. Every string produced by the grammar have bb’s in multiple of 2 , it is also true
Answer:

Related questions

4 votes
4 votes
2 answers
1
Arjun asked Jul 2, 2019
4,600 views
How many states are there in a minimum state automata equivalent to regular expression given below?Regular expression is $a^*b(a+b)$$1$$2$$3$$4$
1 votes
1 votes
1 answer
2