edited by
2,658 views
3 3 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

3 Answers

1 1 vote

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

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

0 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 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:
Position:
Show:

Related questions

4 4 votes
2 answers 2 answers
6.5k
6.5k views
Arjun asked Jul 2, 2019
6,514 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 1 vote
1 1 answer
2.6k
2.6k views
Arjun asked Jul 2, 2019
2,554 views
Match $\text{List-I}$ with $\text{List-II}$ :where $L_1:$ Regular language $L_2:$ Context-free language $L_3:$ Recursive language $L_4:$ Rec...
2 2 votes
1 1 answer
2.0k
2.0k views
Arjun asked Jul 2, 2019
1,993 views
How can the decision algorithm be constructed for deciding whether context-free language $L$ is finite?By constructing redundant CFG G in CNF generating language $L$By co...
4 4 votes
1 1 answer
3.5k
3.5k views
Arjun asked Jul 2, 2019
3,495 views
Which of the following problems is/are decidable problem(s) (recursively enumerable) on turing machine $M$?$G$ is a CFG with $L(G)=\phi$There exist two TMs $M_1$ and $M_2...