edited by
625 views
1 votes
1 votes

Which of the following definitions generates the same languages as $L,$ where

$L = \{x^{n}y^{n},n \geq 1\}$

  1. $E \rightarrow xEy \mid xy$
  2. $xy \mid x^{+}xyy^{+}$
  3. $x^{+}y^{+}$

 

  1. $(i)$
  2. $(i)$ and $(ii)$ only
  3. $(ii)$ and $(iii)$ only
  4. $(ii)$ only
edited by

2 Answers

0 votes
0 votes
The language $L=\{x^ny^n \text{such that }n\geq 1\}$ has following set of strings:

$L=(xy,xxyy,xxxyyy…….\infty)$

1) $E\rightarrow xEy \mid xy$: This grammar can generate all possible string which is generated by language $L.$

 Following strings can be generated by the above grammar: $xy,xxyy,xxxyyy….\infty$  

so this option is correct.

2) $xy\mid x^+xyy^+$: the minimum length of the string that can be generated by this regular expression is $xy$. it can generate all the string which is generated by language $L$ but it can also generate additional string which is not generated by language $L$ such as $xxxyy,xxyyy$. these are invalid strings for language $L.$

so this option is wrong here.

​​​​​​​3) $x^+y^+$: this regular expression generate strings like $xy,xxy,xyy,xxxy,xyyy….\infty$ which is not generated by language $L.$

so this option is also wrong.

$\therefore \text{Option A is correct.}$

​​​​​​​
Answer:

Related questions

3 votes
3 votes
2 answers
2
admin asked Apr 1, 2020
959 views
The logic of pumping lemma is a good example ofthe pigeon-hole principlethe divide and conquer techniquerecursioniteration
0 votes
0 votes
1 answer
3
1 votes
1 votes
1 answer
4
admin asked Apr 1, 2020
1,032 views
A decimal has $25$ digits. The number of bits needed for its equivalent binary representation is approximately,$50$$74$$40$$60$